SurfaceLayerDetectionAlgorithm.hpp
1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once
#include <opencv2/core/mat.hpp>
#include "algorithm/Algorithm.hpp"
namespace Cpu {
class SurfaceLayerDetectionAlgorithm : public Algorithm {
public:
/* Configurable parameters */
cv::Scalar derivativeThreshold{7};
cv::Mat hostMinTemperature;
cv::Mat setMinimumTemperature(ushort temperature);
/* Configurable parameters */
SurfaceLayerDetectionAlgorithm() = default;
void setup(const cv::Size &frameSize, const CVMatLoader &loader) override;
void handleFrame(const cv::Mat &sourceFrame,
unsigned long timestamp) override;
cv::Mat hostSurfaceLayers; /* Surface layers mask */
private:
/* ns to s and invert to multiply instead of divide */
static constexpr double NS_TO_S{1e-5};
cv::Mat hostRegionMask;
cv::Mat hostPreviousPreviousFrame, hostPreviousFrame;
unsigned long previousPreviousTimestamp{}, previousTimestamp{},
currentTimestamp{};
void normalizedDerivative();
/* Buffors */
cv::Mat hostFrame, hostFiltered, hostInput, hostFloatInput, hostDifference,
hostDifferenceAbs, hostResult;
/* Buffors */
};
} // namespace Cpu