removed contrib, legacy and softcsscade modules; removed latentsvm and datamatrix detector from objdetect. removed haartraining and sft apps.
some of the stuff will be moved to opencv_contrib module. in order to make this PR pass buildbot, please, comment off opencv_legacy, opencv_contrib and opencv_softcascade test runs.
This commit is contained in:
@@ -46,7 +46,6 @@
|
||||
|
||||
#include "opencv2/core.hpp"
|
||||
|
||||
typedef struct CvLatentSvmDetector CvLatentSvmDetector;
|
||||
typedef struct CvHaarClassifierCascade CvHaarClassifierCascade;
|
||||
|
||||
namespace cv
|
||||
@@ -54,45 +53,6 @@ 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 LatentSvmDetector
|
||||
{
|
||||
public:
|
||||
struct CV_EXPORTS ObjectDetection
|
||||
{
|
||||
ObjectDetection();
|
||||
ObjectDetection( const Rect& rect, float score, int classID = -1 );
|
||||
Rect rect;
|
||||
float score;
|
||||
int classID;
|
||||
};
|
||||
|
||||
LatentSvmDetector();
|
||||
LatentSvmDetector( const std::vector<String>& filenames, const std::vector<String>& classNames = std::vector<String>() );
|
||||
virtual ~LatentSvmDetector();
|
||||
|
||||
virtual void clear();
|
||||
virtual bool empty() const;
|
||||
bool load( const std::vector<String>& filenames, const std::vector<String>& classNames = std::vector<String>() );
|
||||
|
||||
virtual void detect( const Mat& image,
|
||||
std::vector<ObjectDetection>& objectDetections,
|
||||
float overlapThreshold = 0.5f,
|
||||
int numThreads = -1 );
|
||||
|
||||
const std::vector<String>& getClassNames() const;
|
||||
size_t getClassCount() const;
|
||||
|
||||
private:
|
||||
std::vector<CvLatentSvmDetector*> detectors;
|
||||
std::vector<String> classNames;
|
||||
};
|
||||
|
||||
// class for grouping object candidates, detected by Cascade Classifier, HOG etc.
|
||||
// instance of the class is to be passed to cv::partition (see cxoperations.hpp)
|
||||
class CV_EXPORTS SimilarRects
|
||||
@@ -353,15 +313,6 @@ public:
|
||||
void groupRectangles(std::vector<cv::Rect>& rectList, std::vector<double>& weights, int groupThreshold, double eps) const;
|
||||
};
|
||||
|
||||
|
||||
CV_EXPORTS_W void findDataMatrix(InputArray image,
|
||||
CV_OUT std::vector<String>& codes,
|
||||
OutputArray corners = noArray(),
|
||||
OutputArrayOfArrays dmtx = noArray());
|
||||
|
||||
CV_EXPORTS_W void drawDataMatrixCodes(InputOutputArray image,
|
||||
const std::vector<String>& codes,
|
||||
InputArray corners);
|
||||
}
|
||||
|
||||
#include "opencv2/objdetect/linemod.hpp"
|
||||
|
@@ -144,125 +144,6 @@ CVAPI(int) cvRunHaarClassifierCascade( const CvHaarClassifierCascade* cascade,
|
||||
CvPoint pt, int start_stage CV_DEFAULT(0));
|
||||
|
||||
|
||||
/****************************************************************************************\
|
||||
* Latent SVM Object Detection functions *
|
||||
\****************************************************************************************/
|
||||
|
||||
// DataType: STRUCT position
|
||||
// Structure describes the position of the filter in the feature pyramid
|
||||
// l - level in the feature pyramid
|
||||
// (x, y) - coordinate in level l
|
||||
typedef struct CvLSVMFilterPosition
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int l;
|
||||
} CvLSVMFilterPosition;
|
||||
|
||||
// DataType: STRUCT filterObject
|
||||
// Description of the filter, which corresponds to the part of the object
|
||||
// V - ideal (penalty = 0) position of the partial filter
|
||||
// from the root filter position (V_i in the paper)
|
||||
// penaltyFunction - vector describes penalty function (d_i in the paper)
|
||||
// pf[0] * x + pf[1] * y + pf[2] * x^2 + pf[3] * y^2
|
||||
// FILTER DESCRIPTION
|
||||
// Rectangular map (sizeX x sizeY),
|
||||
// every cell stores feature vector (dimension = p)
|
||||
// H - matrix of feature vectors
|
||||
// to set and get feature vectors (i,j)
|
||||
// used formula H[(j * sizeX + i) * p + k], where
|
||||
// k - component of feature vector in cell (i, j)
|
||||
// END OF FILTER DESCRIPTION
|
||||
typedef struct CvLSVMFilterObject{
|
||||
CvLSVMFilterPosition V;
|
||||
float fineFunction[4];
|
||||
int sizeX;
|
||||
int sizeY;
|
||||
int numFeatures;
|
||||
float *H;
|
||||
} CvLSVMFilterObject;
|
||||
|
||||
// data type: STRUCT CvLatentSvmDetector
|
||||
// structure contains internal representation of trained Latent SVM detector
|
||||
// num_filters - total number of filters (root plus part) in model
|
||||
// num_components - number of components in model
|
||||
// num_part_filters - array containing number of part filters for each component
|
||||
// filters - root and part filters for all model components
|
||||
// b - biases for all model components
|
||||
// score_threshold - confidence level threshold
|
||||
typedef struct CvLatentSvmDetector
|
||||
{
|
||||
int num_filters;
|
||||
int num_components;
|
||||
int* num_part_filters;
|
||||
CvLSVMFilterObject** filters;
|
||||
float* b;
|
||||
float score_threshold;
|
||||
} CvLatentSvmDetector;
|
||||
|
||||
// data type: STRUCT CvObjectDetection
|
||||
// structure contains the bounding box and confidence level for detected object
|
||||
// rect - bounding box for a detected object
|
||||
// score - confidence level
|
||||
typedef struct CvObjectDetection
|
||||
{
|
||||
CvRect rect;
|
||||
float score;
|
||||
} CvObjectDetection;
|
||||
|
||||
//////////////// Object Detection using Latent SVM //////////////
|
||||
|
||||
|
||||
/*
|
||||
// load trained detector from a file
|
||||
//
|
||||
// API
|
||||
// CvLatentSvmDetector* cvLoadLatentSvmDetector(const char* filename);
|
||||
// INPUT
|
||||
// filename - path to the file containing the parameters of
|
||||
- trained Latent SVM detector
|
||||
// OUTPUT
|
||||
// trained Latent SVM detector in internal representation
|
||||
*/
|
||||
CVAPI(CvLatentSvmDetector*) cvLoadLatentSvmDetector(const char* filename);
|
||||
|
||||
/*
|
||||
// release memory allocated for CvLatentSvmDetector structure
|
||||
//
|
||||
// API
|
||||
// void cvReleaseLatentSvmDetector(CvLatentSvmDetector** detector);
|
||||
// INPUT
|
||||
// detector - CvLatentSvmDetector structure to be released
|
||||
// OUTPUT
|
||||
*/
|
||||
CVAPI(void) cvReleaseLatentSvmDetector(CvLatentSvmDetector** detector);
|
||||
|
||||
/*
|
||||
// find rectangular regions in the given image that are likely
|
||||
// to contain objects and corresponding confidence levels
|
||||
//
|
||||
// API
|
||||
// CvSeq* cvLatentSvmDetectObjects(const IplImage* image,
|
||||
// CvLatentSvmDetector* detector,
|
||||
// CvMemStorage* storage,
|
||||
// float overlap_threshold = 0.5f,
|
||||
// int numThreads = -1);
|
||||
// INPUT
|
||||
// image - image to detect objects in
|
||||
// detector - Latent SVM detector in internal representation
|
||||
// storage - memory storage to store the resultant sequence
|
||||
// of the object candidate rectangles
|
||||
// overlap_threshold - threshold for the non-maximum suppression algorithm
|
||||
= 0.5f [here will be the reference to original paper]
|
||||
// OUTPUT
|
||||
// sequence of detected objects (bounding boxes and confidence levels stored in CvObjectDetection structures)
|
||||
*/
|
||||
CVAPI(CvSeq*) cvLatentSvmDetectObjects(IplImage* image,
|
||||
CvLatentSvmDetector* detector,
|
||||
CvMemStorage* storage,
|
||||
float overlap_threshold CV_DEFAULT(0.5f),
|
||||
int numThreads CV_DEFAULT(-1));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -274,16 +155,6 @@ CV_EXPORTS CvSeq* cvHaarDetectObjectsForROC( const CvArr* image,
|
||||
CvSize min_size = cvSize(0, 0), CvSize max_size = cvSize(0, 0),
|
||||
bool outputRejectLevels = false );
|
||||
|
||||
struct CvDataMatrixCode
|
||||
{
|
||||
char msg[4];
|
||||
CvMat* original;
|
||||
CvMat* corners;
|
||||
};
|
||||
|
||||
CV_EXPORTS std::deque<CvDataMatrixCode> cvFindDataMatrix(CvMat *im);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __OPENCV_OBJDETECT_C_H__ */
|
||||
|
Reference in New Issue
Block a user