added c++ wrapper of latent svm
This commit is contained in:
@@ -286,6 +286,45 @@ namespace cv
|
||||
|
||||
///////////////////////////// Object Detection ////////////////////////////
|
||||
|
||||
/*
|
||||
* This is a class wrapping up the structure CvLatentSvmDetector and functions working with it.
|
||||
* The class goals are:
|
||||
* 1) provide c++ interface;
|
||||
* 2) make it possible to load and detect more than one class (model) unlike CvLatentSvmDetector.
|
||||
*/
|
||||
class CV_EXPORTS_W LatentSvmDetector
|
||||
{
|
||||
public:
|
||||
struct CV_EXPORTS_W ObjectDetection
|
||||
{
|
||||
ObjectDetection();
|
||||
ObjectDetection( const Rect& rect, float score, int classID=-1 );
|
||||
Rect rect;
|
||||
float score;
|
||||
int classID;
|
||||
};
|
||||
|
||||
CV_WRAP LatentSvmDetector();
|
||||
CV_WRAP LatentSvmDetector( const vector<string>& filenames, const vector<string>& classNames=vector<string>() );
|
||||
virtual ~LatentSvmDetector();
|
||||
|
||||
CV_WRAP virtual void clear();
|
||||
CV_WRAP virtual bool empty() const;
|
||||
CV_WRAP bool load( const vector<string>& filenames, const vector<string>& classNames=vector<string>() );
|
||||
|
||||
CV_WRAP virtual void detect( const Mat& image,
|
||||
vector<ObjectDetection>& objectDetections,
|
||||
float overlapThreshold=0.5f,
|
||||
int numThreads=-1 );
|
||||
|
||||
const vector<string>& getClassNames() const;
|
||||
size_t getClassCount() const;
|
||||
|
||||
private:
|
||||
vector<CvLatentSvmDetector*> detectors;
|
||||
vector<string> classNames;
|
||||
};
|
||||
|
||||
CV_EXPORTS void groupRectangles(CV_OUT CV_IN_OUT vector<Rect>& rectList, int groupThreshold, double eps=0.2);
|
||||
CV_EXPORTS_W void groupRectangles(CV_OUT CV_IN_OUT vector<Rect>& rectList, CV_OUT vector<int>& weights, int groupThreshold, double eps=0.2);
|
||||
CV_EXPORTS void groupRectangles( vector<Rect>& rectList, int groupThreshold, double eps, vector<int>* weights, vector<double>* levelWeights );
|
||||
|
Reference in New Issue
Block a user