Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpDetectorDNNOpenCV::DetectedFeatures2D Class Reference

#include <vpDetectorDNNOpenCV.h>

Public Member Functions

 DetectedFeatures2D (double u_min, double u_max, double v_min, double v_max, unsigned int cls, double score, const std::optional< std::string > &classname)
vpRect getBoundingBox () const
double getConfidenceScore () const
unsigned int getClassId () const
std::optional< std::string > getClassName () const
template<typename Type>
void display (const vpImage< Type > &img, const vpColor &color=vpColor::blue, unsigned int thickness=1) const

Public Attributes

friend vpDetectorDNNOpenCV

Protected Attributes

vpRect m_bbox
double m_score
unsigned int m_cls
std::optional< std::string > m_classname

Detailed Description

Structure containing the bounding box, expressed in pixels, confidence and class information about an object detected in a image.

Examples
tutorial-dnn-object-detection-live.cpp.

Definition at line 127 of file vpDetectorDNNOpenCV.h.

Constructor & Destructor Documentation

◆ DetectedFeatures2D()

vpDetectorDNNOpenCV::DetectedFeatures2D::DetectedFeatures2D ( double u_min,
double u_max,
double v_min,
double v_max,
unsigned int cls,
double score,
const std::optional< std::string > & classname )
inlineexplicit

Construct a new Detected Features 2 D object.

Parameters
u_minThe left coordinate of the bounding box, expressed in pixel.
u_maxThe right coordinate of the bounding box, expressed in pixel.
v_minThe top coordinate of the bounding box, expressed in pixel.
v_maxThe bottom coordinate of the bounding box, expressed in pixel.
clsThe class ID
scoreThe confidence in the detection.
classnameThe class name, if the class names were given to the vpDetectorDNNOpenCV::NetConfig used to configure the vpDetectorDNNOpenCV object.

Definition at line 146 of file vpDetectorDNNOpenCV.h.

References m_bbox, m_classname, m_cls, and m_score.

Member Function Documentation

◆ display()

template<typename Type>
void vpDetectorDNNOpenCV::DetectedFeatures2D::display ( const vpImage< Type > & img,
const vpColor & color = vpColor::blue,
unsigned int thickness = 1 ) const
inline

Display the bbox and score of the detected object in an image.

Parameters
[in]img: Image used as background.
[in]color: Color used to draw the CAD model.
[in]thickness: Thickness used to draw the CAD model.
Examples
tutorial-dnn-object-detection-live.cpp.

Definition at line 616 of file vpDetectorDNNOpenCV.h.

References display(), vpDisplay::displayRectangle(), vpDisplay::displayText(), m_bbox, m_classname, m_cls, and m_score.

Referenced by display().

◆ getBoundingBox()

vpRect vpDetectorDNNOpenCV::DetectedFeatures2D::getBoundingBox ( ) const
inline

Return the bounding box of the detected object.

Examples
tutorial-dnn-object-detection-live.cpp.

Definition at line 166 of file vpDetectorDNNOpenCV.h.

References m_bbox.

Referenced by vpDetectorDNNOpenCV::filterDetectionMultiClassInput().

◆ getClassId()

unsigned int vpDetectorDNNOpenCV::DetectedFeatures2D::getClassId ( ) const
inline

Return the class ID of the detected object.

Examples
tutorial-dnn-object-detection-live.cpp.

Definition at line 174 of file vpDetectorDNNOpenCV.h.

References m_cls.

Referenced by vpDetectorDNNOpenCV::filterDetectionMultiClassInput().

◆ getClassName()

std::optional< std::string > vpDetectorDNNOpenCV::DetectedFeatures2D::getClassName ( ) const
inline

Return the class name of the detected object.

Examples
tutorial-dnn-object-detection-live.cpp.

Definition at line 178 of file vpDetectorDNNOpenCV.h.

References m_classname.

◆ getConfidenceScore()

double vpDetectorDNNOpenCV::DetectedFeatures2D::getConfidenceScore ( ) const
inline

Return the confidence score of the detected object, a value between 0 and 1.

Examples
tutorial-dnn-object-detection-live.cpp.

Definition at line 170 of file vpDetectorDNNOpenCV.h.

References m_score.

Member Data Documentation

◆ m_bbox

vpRect vpDetectorDNNOpenCV::DetectedFeatures2D::m_bbox
protected

The bounding box of the detected object.

Definition at line 130 of file vpDetectorDNNOpenCV.h.

Referenced by DetectedFeatures2D(), display(), and getBoundingBox().

◆ m_classname

std::optional<std::string> vpDetectorDNNOpenCV::DetectedFeatures2D::m_classname
protected

The class name, if the class names were given to the vpDetectorDNNOpenCV::NetConfig used to configure the vpDetectorDNNOpenCV object.

Definition at line 133 of file vpDetectorDNNOpenCV.h.

Referenced by DetectedFeatures2D(), display(), and getClassName().

◆ m_cls

unsigned int vpDetectorDNNOpenCV::DetectedFeatures2D::m_cls
protected

The class ID.

Definition at line 132 of file vpDetectorDNNOpenCV.h.

Referenced by DetectedFeatures2D(), display(), and getClassId().

◆ m_score

double vpDetectorDNNOpenCV::DetectedFeatures2D::m_score
protected

The confidence in the detection.

Definition at line 131 of file vpDetectorDNNOpenCV.h.

Referenced by DetectedFeatures2D(), display(), and getConfidenceScore().

◆ vpDetectorDNNOpenCV

friend vpDetectorDNNOpenCV::DetectedFeatures2D::vpDetectorDNNOpenCV

Definition at line 183 of file vpDetectorDNNOpenCV.h.