Antal.Ai - Virtual Makeup
Detection.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <opencv2/core/types.hpp>
4 #include <map>
5 
11 namespace core {
12 
20  struct Detection {
29  Detection(float conf, int id, const std::string &name, const cv::Rect &rect) :
30  confidence(conf),
31  classId(id),
32  className(name),
33  boundingRect(rect)
34  {}
35 
45  Detection(float conf, int id, const std::string &name, const cv::Rect &rect, const std::vector<cv::Point>& shape) :
46  confidence(conf),
47  classId(id),
48  className(name),
49  boundingRect(rect),
50  shapePoints(shape)
51  {}
52 
56  Detection() = default;
57 
58  float confidence = 0.0;
59  int classId = -1;
60  std::string className;
61  cv::Rect boundingRect;
62  std::vector<cv::Point> shapePoints;
63  std::map<std::string, std::string> properties;
64  };
65 
66 }//namespace core
A structure to represent the detection details.
Definition: Detection.h:20
Detection(float conf, int id, const std::string &name, const cv::Rect &rect, const std::vector< cv::Point > &shape)
Constructor for Detection with extended parameters including shape points.
Definition: Detection.h:45
std::vector< cv::Point > shapePoints
Shape points of the detection, if available.
Definition: Detection.h:62
int classId
Class ID of the detection.
Definition: Detection.h:59
Detection(float conf, int id, const std::string &name, const cv::Rect &rect)
Constructor for Detection with basic parameters.
Definition: Detection.h:29
std::string className
Class name of the detection.
Definition: Detection.h:60
cv::Rect boundingRect
Bounding rectangle of the detection.
Definition: Detection.h:61
float confidence
Confidence level of the detection.
Definition: Detection.h:58
Detection()=default
Default constructor for Detection.