Struct ImgDetection
Defined in File ImgDetections.hpp
Struct Documentation
-
struct ImgDetection
Public Functions
-
ImgDetection() = default
-
ImgDetection(const RotatedRect &boundingBox, float confidence = 0.f, uint32_t label = 0)
-
ImgDetection(const RotatedRect &boundingBox, std::string labelName, float confidence = 0.f, uint32_t label = 0)
-
ImgDetection(const RotatedRect &boundingBox, const KeypointsList &keypoints, float confidence = 0.f, uint32_t label = 0)
-
ImgDetection(const RotatedRect &boundingBox, const KeypointsList &keypoints, std::string labelName, float confidence = 0.f, uint32_t label = 0)
-
void setBoundingBox(RotatedRect boundingBox)
Sets the bounding box and the legacy coordinates of the detection.
-
RotatedRect getBoundingBox() const
Returns bounding box if it was set, else it constructs a new one from the legacy xmin, ymin, xmax, ymax values.
-
void setOuterBoundingBox(const float xmin, const float ymin, const float xmax, const float ymax)
Sets the bounding box and the legacy coordinates of the detection from the top-left and bottom-right points.
-
std::array<float, 4> getOuterBoundingBox() const
Returns the outer bounding box as [minx, miny, maxx, maxy].
-
void setKeypoints(const KeypointsList keypoints)
Sets the keypoints of the detection.
Note
This will clear any existing keypoints and edges.
- Parameters:
keypoints – list of Keypoint objects to set.
-
void setKeypoints(const std::vector<Keypoint> keypoints)
Sets the keypoints of the detection.
Note
This will clear any existing keypoints and edges.
- Parameters:
keypoints – list of Keypoint objects to set.
-
void setKeypoints(const std::vector<Keypoint> keypoints, const std::vector<Edge> edges)
Sets the keypoints of the detection.
Note
This will clear any existing keypoints and edges.
- Parameters:
keypoints – list of Point2f objects to set.
-
void setKeypoints(const std::vector<Point3f> keypoints)
Sets the keypoints of the detection.
Note
This will clear any existing keypoints and edges.
- Parameters:
keypoints – list of Point3f objects to set.
-
void setKeypoints(const std::vector<Point2f> keypoints)
Sets the keypoints of the detection.
Note
This will clear any existing keypoints and edges.
- Parameters:
keypoints – list of Point2f objects to set.
-
std::vector<Keypoint> getKeypoints() const
Returns a list of Keypoint objects, or empty list if no keypoints were set.
-
std::vector<Point2f> getKeypoints2f() const
Returns a list of Point2f coordinates of the keypoints, or empty list if no keypoints were set.
-
std::vector<Point3f> getKeypoints3f() const
Returns a list of Point3f coordinates of the keypoints, or empty list if no keypoints were set.
-
void setEdges(const std::vector<Edge> edges)
Sets edges for the keypoints, throws if no keypoints were set beforehand.
-
std::vector<Edge> getEdges() const
Returns a list of edges, each edge is a pair of indices, or empty list if no keypoints were set.
-
float getCenterX() const
Returns the X coordinate of the center of the bounding box.
-
float getCenterY() const
Returns the Y coordinate of the center of the bounding box.
-
float getWidth() const
Returns the width of the (rotated) bounding box.
-
float getHeight() const
Returns the height of the (rotated) bounding box.
-
float getAngle() const
Returns the angle of the bounding box.
-
DEPTHAI_SERIALIZE(ImgDetection, label, labelName, confidence, xmin, ymin, xmax, ymax, boundingBox, keypoints)
-
ImgDetection() = default