OpenCV  4.7.0
Open Source Computer Vision
Classes | Public Member Functions | Static Public Member Functions | List of all members
cv::dpm::DPMDetector Class Referenceabstract

This is a C++ abstract class, it provides external user API to work with DPM. More...

#include <opencv2/dpm.hpp>

Classes

struct  ObjectDetection
 

Public Member Functions

virtual ~DPMDetector ()
 
virtual void detect (cv::Mat &image, std::vector< ObjectDetection > &objects)=0
 Find rectangular regions in the given image that are likely to contain objects of loaded classes (models) and corresponding confidence levels. More...
 
virtual size_t getClassCount () const =0
 Return a count of loaded models (classes). More...
 
virtual std::vector< std::string > const & getClassNames () const =0
 Return the class (model) names that were passed in constructor or method load or extracted from models filenames in those methods. More...
 
virtual bool isEmpty () const =0
 

Static Public Member Functions

static cv::Ptr< DPMDetectorcreate (std::vector< std::string > const &filenames, std::vector< std::string > const &classNames=std::vector< std::string >())
 Load the trained models from given .xml files and return cv::Ptr<DPMDetector>. More...
 

Detailed Description

This is a C++ abstract class, it provides external user API to work with DPM.

Constructor & Destructor Documentation

◆ ~DPMDetector()

virtual cv::dpm::DPMDetector::~DPMDetector ( )
inlinevirtual

Member Function Documentation

◆ create()

static cv::Ptr<DPMDetector> cv::dpm::DPMDetector::create ( std::vector< std::string > const &  filenames,
std::vector< std::string > const &  classNames = std::vector< std::string >() 
)
static

Load the trained models from given .xml files and return cv::Ptr<DPMDetector>.

Parameters
filenamesA set of filenames storing the trained detectors (models). Each file contains one model. See examples of such files here /opencv_extra/testdata/cv/dpm/VOC2007_Cascade/.
classNamesA set of trained models names. If it's empty then the name of each model will be constructed from the name of file containing the model. E.g. the model stored in "/home/user/cat.xml" will get the name "cat".

◆ detect()

virtual void cv::dpm::DPMDetector::detect ( cv::Mat image,
std::vector< ObjectDetection > &  objects 
)
pure virtual

Find rectangular regions in the given image that are likely to contain objects of loaded classes (models) and corresponding confidence levels.

Parameters
imageAn image.
objectsThe detections: rectangulars, scores and class IDs.

◆ getClassCount()

virtual size_t cv::dpm::DPMDetector::getClassCount ( ) const
pure virtual

Return a count of loaded models (classes).

◆ getClassNames()

virtual std::vector<std::string> const& cv::dpm::DPMDetector::getClassNames ( ) const
pure virtual

Return the class (model) names that were passed in constructor or method load or extracted from models filenames in those methods.

◆ isEmpty()

virtual bool cv::dpm::DPMDetector::isEmpty ( ) const
pure virtual

The documentation for this class was generated from the following file: