| OpenCV 4.3.0 Open Source Computer Vision

Classes | Public Member Functions | Static Public Member Functions | List of all members
cv::dpm::DPMDetector Class Referenceabstract
Deformable Part-based Models

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< DPMDetector > | create (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 | ( |  | ) |
| inline virtual

## 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

  filenames | A 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/`.
  classNames | A 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

  image | An image.
  objects | The 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:

- opencv2/dpm.hpp