Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpDetectorDNNOpenCV.h
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2025 by Inria. All rights reserved.
4 *
5 * This software is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * See the file LICENSE.txt at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using ViSP with software that can not be combined with the GNU
13 * GPL, please contact Inria about acquiring a ViSP Professional
14 * Edition License.
15 *
16 * See https://visp.inria.fr for more information.
17 *
18 * This software was developed at:
19 * Inria Rennes - Bretagne Atlantique
20 * Campus Universitaire de Beaulieu
21 * 35042 Rennes Cedex
22 * France
23 *
24 * If you have questions regarding the use of this file, please contact
25 * Inria at visp@inria.fr
26 *
27 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29 *
30 * Description:
31 * DNN object detection using OpenCV DNN module.
32 */
33
34#ifndef VP_DETECTOR_DNN_OPENCV_H
35#define VP_DETECTOR_DNN_OPENCV_H
36
37#include <visp3/core/vpConfig.h>
38
39// Check if std:c++17 or higher.
40// Here we cannot use (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17) in the declaration of the class
41#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x030403) && defined(HAVE_OPENCV_DNN) && \
42 ((__cplusplus >= 201703L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)))
43
44#include <map>
45#include <string>
46#include <vector>
47
48#include <opencv2/dnn.hpp>
49
50#include <visp3/core/vpColor.h>
51#include <visp3/core/vpDisplay.h>
52#include <visp3/core/vpImage.h>
53#include <visp3/core/vpRect.h>
54
55#include <optional>
56
57#ifdef VISP_HAVE_NLOHMANN_JSON
58#include VISP_NLOHMANN_JSON(json.hpp)
59#endif
60
91class VISP_EXPORT vpDetectorDNNOpenCV
92{
93public:
114
115 typedef struct DetectionCandidates
116 {
117 std::vector< float > m_confidences;
118 std::vector< cv::Rect > m_boxes;
119 std::vector< int > m_classIds;
120 } DetectionCandidates;
121
127 typedef class DetectedFeatures2D
128 {
129 protected:
131 double m_score;
132 unsigned int m_cls;
133 std::optional<std::string> m_classname;
134 public:
146 inline explicit DetectedFeatures2D(double u_min, double u_max
147 , double v_min, double v_max
148 , unsigned int cls, double score
149 , const std::optional<std::string> &classname
150 )
151 : m_bbox(vpImagePoint(v_min, u_min), vpImagePoint(v_max, u_max))
152 , m_score(score)
153 , m_cls(cls)
154 {
155 if (classname) {
156 m_classname = classname;
157 }
158 else {
159 m_classname = std::nullopt;
160 }
161 }
162
166 inline vpRect getBoundingBox() const { return m_bbox; }
170 inline double getConfidenceScore() const { return m_score; }
174 inline unsigned int getClassId() const { return m_cls; }
178 inline std::optional<std::string> getClassName() const { return m_classname; }
179
180 template < typename Type >
181 void display(const vpImage< Type > &img, const vpColor &color = vpColor::blue, unsigned int thickness = 1) const;
182
184 } DetectedFeatures2D;
185
190 typedef class NetConfig
191 {
192 private:
193 float m_confThreshold;
194 float m_nmsThreshold;
195 std::vector<std::string> m_classNames;
196 cv::Size m_inputSize;
197 double m_filterSizeRatio;
199 cv::Scalar m_mean;
200 double m_scaleFactor;
201 bool m_swapRB;
202 DNNResultsParsingType m_parsingMethodType;
203 std::string m_modelFilename;
204 std::string m_modelConfigFilename;
205 std::string m_framework;
206
207#ifdef VISP_HAVE_NLOHMANN_JSON
215 friend inline void from_json(const nlohmann::json &j, NetConfig &config)
216 {
217 config.m_confThreshold = j.value("confidenceThreshold", config.m_confThreshold);
218 if (config.m_confThreshold <= 0) {
219 throw vpException(vpException::badValue, "Confidence threshold should be > 0");
220 }
221
222 config.m_nmsThreshold = j.value("nmsThreshold", config.m_nmsThreshold);
223 if (config.m_nmsThreshold <= 0) {
224 throw vpException(vpException::badValue, "Confidence threshold should be > 0");
225 }
226
227 config.m_filterSizeRatio = j.value("filterSizeRatio", config.m_filterSizeRatio);
228
229 config.m_classNames = j.value("classNames", config.m_classNames);
230
231 std::pair<unsigned int, unsigned int> resolution = j.value("resolution", std::pair<unsigned int, unsigned int>(config.m_inputSize.width, config.m_inputSize.height));
232 config.m_inputSize.width = resolution.first;
233 config.m_inputSize.height = resolution.second;
234
235 std::vector<double> v_mean = j.value("mean", std::vector<double>({ config.m_mean[0], config.m_mean[1], config.m_mean[2] }));
236 if (v_mean.size() != 3) {
237 throw(vpException(vpException::dimensionError, "Mean should have size = 3"));
238 }
239 config.m_mean = cv::Scalar(v_mean[0], v_mean[1], v_mean[2]);
240
241 config.m_scaleFactor = j.value("scale", config.m_scaleFactor);
242 config.m_swapRB = j.value("swapRB", config.m_swapRB);
243 config.m_parsingMethodType = dnnResultsParsingTypeFromString(j.value("parsingType", dnnResultsParsingTypeToString(config.m_parsingMethodType)));
244 config.m_modelFilename = j.value("modelFile", config.m_modelFilename);
245 config.m_modelConfigFilename = j.value("configurationFile", config.m_modelConfigFilename);
246 config.m_framework = j.value("framework", config.m_framework);
247 }
248
255 friend inline void to_json(nlohmann::json &j, const NetConfig &config)
256 {
257 std::pair<unsigned int, unsigned int> resolution = { config.m_inputSize.width, config.m_inputSize.height };
258 std::vector<double> v_mean = { config.m_mean[0], config.m_mean[1], config.m_mean[2] };
259 j = nlohmann::json {
260 {"confidenceThreshold", config.m_confThreshold } ,
261 {"nmsThreshold" , config.m_nmsThreshold } ,
262 {"filterSizeRatio" , config.m_filterSizeRatio} ,
263 {"classNames" , config.m_classNames } ,
264 {"resolution" , resolution } ,
265 {"mean" , v_mean } ,
266 {"scale" , config.m_scaleFactor } ,
267 {"swapRB" , config.m_swapRB } ,
268 {"parsingType" , dnnResultsParsingTypeToString(config.m_parsingMethodType) },
269 {"modelFile" , config.m_modelFilename } ,
270 {"configurationFile" , config.m_modelConfigFilename } ,
271 {"framework" , config.m_framework }
272 };
273 }
274#endif
275
276 public:
299 inline static std::vector<std::string> parseClassNamesFile(const std::string &filename)
300 {
301 std::vector<std::string> classNames;
302 std::ifstream ifs(filename);
303 std::string line;
304 while (getline(ifs, line)) {
305 if (line.find("[") == std::string::npos) {
306 classNames.push_back(line);
307 }
308 else {
309 std::string lineWithoutBracket;
310 if (line.find("[") != std::string::npos) {
311 lineWithoutBracket = line.substr(line.find("[") + 1, line.size() - 2); // Remove opening and closing brackets
312 }
313
314 while (!lineWithoutBracket.empty()) {
315 std::string className;
316 auto start_pos = lineWithoutBracket.find("\"");
317 auto end_pos = lineWithoutBracket.find("\"", start_pos + 1);
318 className = lineWithoutBracket.substr(start_pos + 1, end_pos - (start_pos + 1));
319 if (!className.empty()) {
320 classNames.push_back(className);
321 lineWithoutBracket = lineWithoutBracket.substr(end_pos + 1);
322 }
323 }
324 }
325 }
326 return classNames;
327 }
328
332 inline NetConfig()
333 : m_confThreshold(0.5f)
334 , m_nmsThreshold(0.4f)
335 , m_classNames()
336 , m_inputSize(300, 300)
337 , m_filterSizeRatio(0.)
338 , m_mean(127.5, 127.5, 127.5)
339 , m_scaleFactor(2.0 / 255.0)
340 , m_swapRB(true)
341 , m_parsingMethodType(vpDetectorDNNOpenCV::USER_SPECIFIED)
342 , m_modelFilename()
343 , m_modelConfigFilename()
344 , m_framework()
345 {
346
347 }
348
349 inline NetConfig(const NetConfig &config)
350 : m_confThreshold(config.m_confThreshold)
351 , m_nmsThreshold(config.m_nmsThreshold)
352 , m_classNames(config.m_classNames)
353 , m_inputSize(config.m_inputSize.width, config.m_inputSize.height)
354 , m_filterSizeRatio(config.m_filterSizeRatio)
355 , m_mean(cv::Scalar(config.m_mean[0], config.m_mean[1], config.m_mean[2]))
356 , m_scaleFactor(config.m_scaleFactor)
357 , m_swapRB(config.m_swapRB)
358 , m_parsingMethodType(config.m_parsingMethodType)
359 , m_modelFilename(config.m_modelFilename)
360 , m_modelConfigFilename(config.m_modelConfigFilename)
361 , m_framework(config.m_framework)
362 {
363
364 }
365
383 inline NetConfig(float confThresh, const float &nmsThresh, const std::vector<std::string> &classNames, const cv::Size &dnnInputSize, const double &filterSizeRatio = 0.
384 , const cv::Scalar &mean = cv::Scalar(127.5, 127.5, 127.5), const double &scaleFactor = 2. / 255., const bool &swapRB = true
385 , const DNNResultsParsingType &parsingType = vpDetectorDNNOpenCV::USER_SPECIFIED, const std::string &modelFilename = "", const std::string &configFilename = "", const std::string &framework = "")
386 : m_confThreshold(confThresh)
387 , m_nmsThreshold(nmsThresh)
388 , m_classNames(classNames)
389 , m_inputSize(dnnInputSize)
390 , m_filterSizeRatio(filterSizeRatio)
391 , m_mean(mean)
392 , m_scaleFactor(scaleFactor)
393 , m_swapRB(swapRB)
394 , m_parsingMethodType(parsingType)
395 , m_modelFilename(modelFilename)
396 , m_modelConfigFilename(configFilename)
397 , m_framework(framework)
398 { }
399
417 inline NetConfig(const float &confThresh, const float &nmsThresh, const std::string &classNamesFile, const cv::Size &dnnInputSize, const double &filterSizeRatio = 0.
418 , const cv::Scalar &mean = cv::Scalar(127.5, 127.5, 127.5), const double &scaleFactor = 2. / 255., const bool &swapRB = true
419 , const DNNResultsParsingType &parsingType = vpDetectorDNNOpenCV::USER_SPECIFIED, const std::string &modelFilename = "", const std::string &configFilename = "", const std::string &framework = "")
420 : m_confThreshold(confThresh)
421 , m_nmsThreshold(nmsThresh)
422 , m_inputSize(dnnInputSize)
423 , m_filterSizeRatio(filterSizeRatio)
424 , m_mean(mean)
425 , m_scaleFactor(scaleFactor)
426 , m_swapRB(swapRB)
427 , m_parsingMethodType(parsingType)
428 , m_modelFilename(modelFilename)
429 , m_modelConfigFilename(configFilename)
430 , m_framework(framework)
431 {
432 m_classNames = parseClassNamesFile(classNamesFile);
433 }
434
435 inline std::string toString() const
436 {
437 std::string text;
438 text += "Model : " + m_modelFilename + "\n";
439 text += "Type : " + vpDetectorDNNOpenCV::dnnResultsParsingTypeToString(m_parsingMethodType) + "\n";
440 text += "Config (optional): " + (m_modelConfigFilename.empty() ? "\"None\"" : m_modelConfigFilename) + "\n";
441 text += "Framework (optional): " + (m_framework.empty() ? "\"None\"" : m_framework) + "\n";
442 text += "Width x Height : " + std::to_string(m_inputSize.width) + " x " + std::to_string(m_inputSize.height) + "\n";
443 text += "Mean RGB : " + std::to_string(m_mean[0]) + " " + std::to_string(m_mean[1]) + " " + std::to_string(m_mean[2]) + "\n";
444 text += "Scale : " + std::to_string(m_scaleFactor) + "\n";
445 text += "Swap RB? : " + (m_swapRB ? std::string("true") : std::string("false")) + "\n";
446 text += "Confidence threshold : " + std::to_string(m_confThreshold) + "\n";
447 text += "NMS threshold : " + std::to_string(m_nmsThreshold) + "\n";
448 text += "Filter threshold : " +
449 (m_filterSizeRatio > std::numeric_limits<double>::epsilon() ? std::to_string(m_filterSizeRatio)
450 : "disabled") + "\n";
451 return text;
452 }
453
454 friend inline std::ostream &operator<<(std::ostream &os, const NetConfig &config)
455 {
456 os << config.toString();
457 return os;
458 }
459
461 {
462 m_confThreshold = config.m_confThreshold;
463 m_nmsThreshold = config.m_nmsThreshold;
464 m_classNames = config.m_classNames;
465 m_inputSize = cv::Size(config.m_inputSize.width, config.m_inputSize.height);
466 m_filterSizeRatio = config.m_filterSizeRatio;
467 m_mean = cv::Scalar(config.m_mean[0], config.m_mean[1], config.m_mean[2]);
468 m_scaleFactor = config.m_scaleFactor;
469 m_swapRB = config.m_swapRB;
470 m_parsingMethodType = config.m_parsingMethodType;
471 m_modelFilename = config.m_modelFilename;
472 m_modelConfigFilename = config.m_modelConfigFilename;
473 m_framework = config.m_framework;
474 return *this;
475 }
476
478 } NetConfig;
479
480 static std::string getAvailableDnnResultsParsingTypes();
481 static std::string dnnResultsParsingTypeToString(const DNNResultsParsingType &type);
482 static DNNResultsParsingType dnnResultsParsingTypeFromString(const std::string &name);
483 static std::vector<std::string> parseClassNamesFile(const std::string &filename);
485 vpDetectorDNNOpenCV(const NetConfig &config, const DNNResultsParsingType &typeParsingMethod, void (*parsingMethod)(DetectionCandidates &, std::vector<cv::Mat> &, const NetConfig &) = postProcess_unimplemented);
486#ifdef VISP_HAVE_NLOHMANN_JSON
487 vpDetectorDNNOpenCV(const std::string &jsonPath, void (*parsingMethod)(DetectionCandidates &, std::vector<cv::Mat> &, const NetConfig &) = postProcess_unimplemented);
488 void initFromJSON(const std::string &jsonPath);
489 void saveConfigurationInJSON(const std::string &jsonPath) const;
490#endif
491 virtual ~vpDetectorDNNOpenCV();
492
493 virtual bool detect(const vpImage<unsigned char> &I, std::vector<DetectedFeatures2D> &output);
494 virtual bool detect(const vpImage<unsigned char> &I, std::map< std::string, std::vector<DetectedFeatures2D>> &output);
495 virtual bool detect(const vpImage<unsigned char> &I, std::vector< std::pair<std::string, std::vector<DetectedFeatures2D>>> &output);
496 virtual bool detect(const vpImage<vpRGBa> &I, std::vector<DetectedFeatures2D> &output);
497 virtual bool detect(const vpImage<vpRGBa> &I, std::map< std::string, std::vector<DetectedFeatures2D>> &output);
498 virtual bool detect(const vpImage<vpRGBa> &I, std::vector< std::pair<std::string, std::vector<DetectedFeatures2D>>> &output);
499 virtual bool detect(const cv::Mat &I, std::vector<DetectedFeatures2D> &output);
500 virtual bool detect(const cv::Mat &I, std::map< std::string, std::vector<DetectedFeatures2D>> &output);
501 virtual bool detect(const cv::Mat &I, std::vector< std::pair<std::string, std::vector<DetectedFeatures2D>>> &output);
502
503 void readNet(const std::string &model, const std::string &config = "", const std::string &framework = "");
504
505 void setNetConfig(const NetConfig &config);
506 void setConfidenceThreshold(const float &confThreshold);
507 void setNMSThreshold(const float &nmsThreshold);
508 void setDetectionFilterSizeRatio(const double &sizeRatio);
509 void setInputSize(const int &width, const int &height);
510 void setMean(const double &meanR, const double &meanG, const double &meanB);
511 void setPreferableBackend(const int &backendId);
512 void setPreferableTarget(const int &targetId);
513 void setScaleFactor(const double &scaleFactor);
514 void setSwapRB(const bool &swapRB);
515 void setParsingMethod(const DNNResultsParsingType &typeParsingMethod, void (*parsingMethod)(DetectionCandidates &, std::vector<cv::Mat> &, const NetConfig &) = postProcess_unimplemented);
516 inline const NetConfig &getNetConfig() const
517 {
518 return m_netConfig;
519 }
520
521#ifdef VISP_HAVE_NLOHMANN_JSON
529 friend inline void from_json(const nlohmann::json &j, vpDetectorDNNOpenCV &network)
530 {
531 network.m_netConfig = j.value("networkSettings", network.m_netConfig);
532 }
533
540 friend inline void to_json(nlohmann::json &j, const vpDetectorDNNOpenCV &network)
541 {
542 j = nlohmann::json {
543 {"networkSettings", network.m_netConfig}
544 };
545 }
546#endif
547
548 friend inline std::ostream &operator<<(std::ostream &os, const vpDetectorDNNOpenCV &network)
549 {
550 os << network.m_netConfig;
551 return os;
552 }
553
554protected:
555#if (VISP_HAVE_OPENCV_VERSION == 0x030403)
556 std::vector<cv::String> getOutputsNames();
557#endif
558 std::vector<DetectedFeatures2D>
559 filterDetectionSingleClassInput(const std::vector<DetectedFeatures2D> &detected_features, const double minRatioOfAreaOk);
560
561 std::vector<DetectedFeatures2D>
562 filterDetectionMultiClassInput(const std::vector<DetectedFeatures2D> &detected_features, const double minRatioOfAreaOk);
563
564 std::map<std::string, std::vector<vpDetectorDNNOpenCV::DetectedFeatures2D>>
565 filterDetectionMultiClassInput(const std::map< std::string, std::vector<vpDetectorDNNOpenCV::DetectedFeatures2D>> &detected_features, const double minRatioOfAreaOk);
566
567 void postProcess(DetectionCandidates &proposals);
568
569 void postProcess_YoloV3_V4(DetectionCandidates &proposals, std::vector<cv::Mat> &dnnRes, const NetConfig &netConfig);
570
571 void postProcess_YoloV5_V7(DetectionCandidates &proposals, std::vector<cv::Mat> &dnnRes, const NetConfig &netConfig);
572
573 void postProcess_YoloV8_V11_V12(DetectionCandidates &proposals, std::vector<cv::Mat> &dnnRes, const NetConfig &netConfig);
574
575 void postProcess_FasterRCNN(DetectionCandidates &proposals, std::vector<cv::Mat> &dnnRes, const NetConfig &netConfig);
576
577#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
578 void postProcess_SSD_MobileNet(DetectionCandidates &proposals, std::vector<cv::Mat> &dnnRes, const NetConfig &netConfig);
579#endif
580
581 void postProcess_ResNet_10(DetectionCandidates &proposals, std::vector<cv::Mat> &dnnRes, const NetConfig &netConfig);
582
583 static void postProcess_unimplemented(DetectionCandidates &proposals, std::vector<cv::Mat> &dnnRes, const NetConfig &netConfig);
584
588 cv::Mat m_blob;
592 cv::Mat m_img;
594 std::vector<int> m_indices;
596 cv::dnn::Net m_net;
600 std::vector<cv::String> m_outNames;
602 std::vector<cv::Mat> m_dnnRes;
604 void (*m_parsingMethod)(DetectionCandidates &, std::vector<cv::Mat> &, const NetConfig &);
605};
606
614template < typename Type >
615inline void
616vpDetectorDNNOpenCV::DetectedFeatures2D::display(const vpImage< Type > &img, const vpColor &color, unsigned int thickness) const
617{
618 vpDisplay::displayRectangle(img, m_bbox, color, false, thickness);
619
620 std::stringstream ss;
621 if (m_classname) {
622 ss << *m_classname;
623 }
624 else {
625 ss << m_cls;
626 }
627 ss << "(" << std::setprecision(4) << m_score * 100. << "%)";
628 vpDisplay::displayText(img, m_bbox.getTopRight(), ss.str(), color);
629}
630END_VISP_NAMESPACE
631#endif
632#endif
Class to define RGB colors available for display functionalities.
Definition vpColor.h:157
static const vpColor blue
Definition vpColor.h:204
void display(const vpImage< Type > &img, const vpColor &color=vpColor::blue, unsigned int thickness=1) const
DetectedFeatures2D(double u_min, double u_max, double v_min, double v_max, unsigned int cls, double score, const std::optional< std::string > &classname)
Construct a new Detected Features 2 D object.
std::optional< std::string > getClassName() const
Structure containing some information required for the configuration of a vpDetectorDNNOpenCV object.
NetConfig(const NetConfig &config)
friend void to_json(nlohmann::json &j, const NetConfig &config)
Parse a vpDetectorDNNOpenCV::NetConfig into JSON format.
NetConfig()
Default constructor of the structure vpDetectorDNNOpenCV::NetConfig , required for JSON serialization...
friend std::ostream & operator<<(std::ostream &os, const NetConfig &config)
friend void from_json(const nlohmann::json &j, NetConfig &config)
Read the network configuration from JSON. All values are optional and if an argument is not present,...
NetConfig(float confThresh, const float &nmsThresh, const std::vector< std::string > &classNames, const cv::Size &dnnInputSize, const double &filterSizeRatio=0., const cv::Scalar &mean=cv::Scalar(127.5, 127.5, 127.5), const double &scaleFactor=2./255., const bool &swapRB=true, const DNNResultsParsingType &parsingType=vpDetectorDNNOpenCV::USER_SPECIFIED, const std::string &modelFilename="", const std::string &configFilename="", const std::string &framework="")
Construct a new Net Config object.
NetConfig & operator=(const NetConfig &config)
NetConfig(const float &confThresh, const float &nmsThresh, const std::string &classNamesFile, const cv::Size &dnnInputSize, const double &filterSizeRatio=0., const cv::Scalar &mean=cv::Scalar(127.5, 127.5, 127.5), const double &scaleFactor=2./255., const bool &swapRB=true, const DNNResultsParsingType &parsingType=vpDetectorDNNOpenCV::USER_SPECIFIED, const std::string &modelFilename="", const std::string &configFilename="", const std::string &framework="")
Construct a new Net Config object.
static std::vector< std::string > parseClassNamesFile(const std::string &filename)
Parse the file containing the list of classes the DNN can detect. These classes can be written either...
friend void from_json(const nlohmann::json &j, vpDetectorDNNOpenCV &network)
Read the network configuration from JSON. All values are optional and if an argument is not present,...
cv::Mat m_blob
Buffer for the blob in input net.
DNNResultsParsingType
Enumeration listing the types of DNN for which the vpDetectorDNNOpenCV furnishes the methods permitti...
static DNNResultsParsingType dnnResultsParsingTypeFromString(const std::string &name)
std::vector< cv::String > m_outNames
Names of layers with unconnected outputs.
friend void to_json(nlohmann::json &j, const vpDetectorDNNOpenCV &network)
Parse the network configuration into JSON format.
cv::Mat m_img
Buffer for the input image.
std::vector< int > m_indices
Indices for NMS.
NetConfig m_netConfig
Configuration of the DNN.
std::vector< cv::Mat > m_dnnRes
Contains all output blobs for each layer specified in m_outNames.
cv::dnn::Net m_net
DNN network.
bool m_applySizeFilterAfterNMS
If true, filter the detections removing the ones for which the bbox does not respect area(bbox) € [me...
friend std::ostream & operator<<(std::ostream &os, const vpDetectorDNNOpenCV &network)
const NetConfig & getNetConfig() const
static std::string dnnResultsParsingTypeToString(const DNNResultsParsingType &type)
void(* m_parsingMethod)(DetectionCandidates &, std::vector< cv::Mat > &, const NetConfig &)
Pointer towards the parsing method, used if m_parsingMethodType is equal to m_parsingMethodType::USER...
vpImage< vpRGBa > m_I_color
Buffer for gray to RGBa image conversion.
static void displayRectangle(const vpImage< unsigned char > &I, const vpImagePoint &topLeft, unsigned int width, unsigned int height, const vpColor &color, bool fill=false, unsigned int thickness=1)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
error that can be emitted by ViSP classes.
Definition vpException.h:60
@ badValue
Used to indicate that a value is not in the allowed range.
Definition vpException.h:73
@ dimensionError
Bad dimension.
Definition vpException.h:71
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition of the vpImage class member functions.
Definition vpImage.h:131
Defines a rectangle in the plane.
Definition vpRect.h:79