Add Throttle Value
This commit is contained in:
@@ -25,6 +25,16 @@ bool ImageAnalyzer::ProcessImage(uint32_t width, uint32_t height, uint8_t *imgPo
|
|||||||
static int temp_threshold = BITS14;
|
static int temp_threshold = BITS14;
|
||||||
static int fault_area = ZERO;
|
static int fault_area = ZERO;
|
||||||
|
|
||||||
|
if (throttle_count == THROTTLE_AMOUNT)
|
||||||
|
{
|
||||||
|
throttle_count = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throttle_count++;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Read in frame
|
// Read in frame
|
||||||
if (!test)
|
if (!test)
|
||||||
frame = Mat(height, width, CV_16UC1, imgPointer, Mat::AUTO_STEP);
|
frame = Mat(height, width, CV_16UC1, imgPointer, Mat::AUTO_STEP);
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
#include <opencv2/core.hpp>
|
#include <opencv2/core.hpp>
|
||||||
#include "FaultManager.hpp"
|
#include "FaultManager.hpp"
|
||||||
|
|
||||||
|
#define THROTTLE_AMOUNT 1
|
||||||
|
|
||||||
class ImageAnalyzer
|
class ImageAnalyzer
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -11,6 +13,10 @@ public:
|
|||||||
|
|
||||||
bool ProcessImage(uint32_t width, uint32_t height, uint8_t *imgPointer, FaultManager fault_mgr, bool test);
|
bool ProcessImage(uint32_t width, uint32_t height, uint8_t *imgPointer, FaultManager fault_mgr, bool test);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
int throttle_count = 1;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in New Issue
Block a user