diff --git a/ImageAnalyzer.cpp b/ImageAnalyzer.cpp index 7ee723b..c989612 100644 --- a/ImageAnalyzer.cpp +++ b/ImageAnalyzer.cpp @@ -25,6 +25,16 @@ bool ImageAnalyzer::ProcessImage(uint32_t width, uint32_t height, uint8_t *imgPo static int temp_threshold = BITS14; static int fault_area = ZERO; + if (throttle_count == THROTTLE_AMOUNT) + { + throttle_count = 1; + } + else + { + throttle_count++; + return true; + } + // Read in frame if (!test) frame = Mat(height, width, CV_16UC1, imgPointer, Mat::AUTO_STEP); diff --git a/ImageAnalyzer.hpp b/ImageAnalyzer.hpp index 3b4be4e..c7d9963 100644 --- a/ImageAnalyzer.hpp +++ b/ImageAnalyzer.hpp @@ -4,6 +4,8 @@ #include #include "FaultManager.hpp" +#define THROTTLE_AMOUNT 1 + class ImageAnalyzer { @@ -11,6 +13,10 @@ public: bool ProcessImage(uint32_t width, uint32_t height, uint8_t *imgPointer, FaultManager fault_mgr, bool test); +private: + + int throttle_count = 1; + }; #endif \ No newline at end of file