35 #ifndef _vpDetectorDNN_h_ 36 #define _vpDetectorDNN_h_ 38 #include <visp3/core/vpConfig.h> 40 #if (VISP_HAVE_OPENCV_VERSION >= 0x030403) 41 #include <opencv2/dnn.hpp> 42 #include <visp3/detection/vpDetectorBase.h> 61 std::vector<vpRect> getDetectionBBs(
bool afterNMS=
true)
const;
62 std::vector<int> getDetectionClassIds(
bool afterNMS=
true)
const;
63 std::vector<float> getDetectionConfidence(
bool afterNMS=
true)
const;
65 void readNet(
const std::string &model,
const std::string &config=
"",
const std::string &framework=
"");
66 void setConfidenceThreshold(
float confThreshold);
67 void setInputSize(
int width,
int height);
68 void setMean(
double meanR,
double meanG,
double meanB);
69 void setNMSThreshold(
float nmsThreshold);
70 void setPreferableBackend(
int backendId);
71 void setPreferableTarget(
int targetId);
72 void setScaleFactor(
double scaleFactor);
73 void setSwapRB(
bool swapRB);
76 #if (VISP_HAVE_OPENCV_VERSION == 0x030403) 77 std::vector<cv::String> getOutputsNames();
84 std::vector<cv::Rect> m_boxes;
86 std::vector<cv::Rect> m_boxesNMS;
88 std::vector<int> m_classIds;
90 std::vector<float> m_confidences;
92 float m_confidenceThreshold;
98 std::vector<int> m_indices;
100 cv::Size m_inputSize;
106 float m_nmsThreshold;
108 std::vector<cv::String> m_outNames;
110 std::vector<cv::Mat> m_outs;
112 double m_scaleFactor;
virtual bool detect(const vpImage< unsigned char > &I)=0