forked from Smorodov/Multitarget-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOCVDNNDetector.h
More file actions
46 lines (36 loc) · 1002 Bytes
/
OCVDNNDetector.h
File metadata and controls
46 lines (36 loc) · 1002 Bytes
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
#pragma once
#include "BaseDetector.h"
#include <opencv2/dnn.hpp>
#include <opencv2/dnn/shape_utils.hpp>
///
/// \brief The OCVDNNDetector class
///
class OCVDNNDetector : public BaseDetector
{
public:
OCVDNNDetector(const cv::UMat& colorFrame);
~OCVDNNDetector(void);
bool Init(const config_t& config);
void Detect(const cv::UMat& colorFrame);
bool CanGrayProcessing() const
{
return false;
}
private:
cv::dnn::Net m_net;
void DetectInCrop(const cv::UMat& colorFrame, const cv::Rect& crop, regions_t& tmpRegions);
int m_inWidth = 608;
int m_inHeight = 608;
float m_WHRatio = 1.f;
float m_inScaleFactor = 0.003921f;
float m_meanVal = 0.f;
float m_confidenceThreshold = 0.24f;
float m_nmsThreshold = 0.4f;
bool m_swapRB = false;
float m_maxCropRatio = 2.0f;
std::vector<std::string> m_classNames;
std::vector<std::string> m_outNames;
std::vector<int> m_outLayers;
std::string m_outLayerType;
cv::UMat m_inputBlob;
};