OverloadHotspotDetectionAlgorithm.hpp
1.39 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
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include <opencv2/core/mat.hpp>
#include "algorithm/Algorithm.hpp"
#include "algorithm/cpu/common/ClusterCorrespondence.hpp"
#include "algorithm/cpu/hotspot/Hotspot.hpp"
#include "algorithm/common/PfcSegmenter.hpp"
#include "algorithm/common/SurfaceMap.hpp"
namespace Cpu {
class OverloadHotspotDetectionAlgorithm : public Algorithm {
public:
/* Configurable parameters */
std::size_t blobsLimit{5};
std::size_t pixelsThreshold{3};
/* Configurable parameters */
OverloadHotspotDetectionAlgorithm() = default;
void setup(const cv::Size &frameSize, const CVMatLoader &loader) override;
void handleFrame(const cv::Mat &sourceFrame,
unsigned long timestamp) override;
std::vector<Cpu::PersistentHotspot> uniqueHotspots; /* Set of persistent hotspots */
private:
using Contours = std::vector<std::vector<cv::Point>>;
static constexpr int KELVINS{273};
static constexpr int MAX_TEMPERATURE{(1L << 15) - 1};
cv::Size currentFrameSize;
Cpu::ClusterCorrespondence clusterCorrespondence{.8, 2.};
std::unique_ptr<const SurfaceMap> surfaceMap;
cv::Mat hostFov, hostModel, hostPfc;
cv::Mat hostPfcMask;
std::vector<Cpu::Hotspot> currentHotspots;
void identifyHotspots(unsigned long timestamp);
void matchHotspot(const Cpu::Hotspot &hotspot);
/* Buffors */
cv::Mat overheating;
cv::Mat hostFrame, hostInput, hostTemperature;
/* Buffors */
};
} // namespace Cpu