Revert "Add a variant of detectMultiScale with an argument 'weights'"
It was merged by mistake. This reverts commit ab6be9b7b7691967e42297aa6d3a67fb07597fd8.
This commit is contained in:
parent
52e9974431
commit
d583a79869
@ -189,7 +189,6 @@ CascadeClassifier::detectMultiScale
|
|||||||
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
|
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
|
||||||
|
|
||||||
.. ocv:function:: void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), Size maxSize=Size())
|
.. ocv:function:: void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), Size maxSize=Size())
|
||||||
.. ocv:function:: void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects, vector<int>& weights, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), Size maxSize=Size())
|
|
||||||
|
|
||||||
.. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects
|
.. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects
|
||||||
.. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale(image, rejectLevels, levelWeights[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) -> objects
|
.. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale(image, rejectLevels, levelWeights[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) -> objects
|
||||||
@ -204,8 +203,6 @@ Detects objects of different sizes in the input image. The detected objects are
|
|||||||
|
|
||||||
:param objects: Vector of rectangles where each rectangle contains the detected object.
|
:param objects: Vector of rectangles where each rectangle contains the detected object.
|
||||||
|
|
||||||
:param weights: Vector of weights of the corresponding objects. Weight is the number of neighboring positively classified rectangles that were joined into one object.
|
|
||||||
|
|
||||||
:param scaleFactor: Parameter specifying how much the image size is reduced at each image scale.
|
:param scaleFactor: Parameter specifying how much the image size is reduced at each image scale.
|
||||||
|
|
||||||
:param minNeighbors: Parameter specifying how many neighbors each candidate rectangle should have to retain it.
|
:param minNeighbors: Parameter specifying how many neighbors each candidate rectangle should have to retain it.
|
||||||
|
@ -382,14 +382,6 @@ public:
|
|||||||
Size minSize=Size(),
|
Size minSize=Size(),
|
||||||
Size maxSize=Size() );
|
Size maxSize=Size() );
|
||||||
|
|
||||||
CV_WRAP virtual void detectMultiScale( const Mat& image,
|
|
||||||
CV_OUT vector<Rect>& objects,
|
|
||||||
vector<int>& weights,
|
|
||||||
double scaleFactor=1.1,
|
|
||||||
int minNeighbors=3, int flags=0,
|
|
||||||
Size minSize=Size(),
|
|
||||||
Size maxSize=Size() );
|
|
||||||
|
|
||||||
CV_WRAP virtual void detectMultiScale( const Mat& image,
|
CV_WRAP virtual void detectMultiScale( const Mat& image,
|
||||||
CV_OUT vector<Rect>& objects,
|
CV_OUT vector<Rect>& objects,
|
||||||
vector<int>& rejectLevels,
|
vector<int>& rejectLevels,
|
||||||
@ -398,8 +390,7 @@ public:
|
|||||||
int minNeighbors=3, int flags=0,
|
int minNeighbors=3, int flags=0,
|
||||||
Size minSize=Size(),
|
Size minSize=Size(),
|
||||||
Size maxSize=Size(),
|
Size maxSize=Size(),
|
||||||
bool outputRejectLevels=false,
|
bool outputRejectLevels=false );
|
||||||
bool outputWeights=false );
|
|
||||||
|
|
||||||
|
|
||||||
bool isOldFormatCascade() const;
|
bool isOldFormatCascade() const;
|
||||||
|
@ -1023,7 +1023,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct getRect { Rect operator ()(const CvAvgComp& e) const { return e.rect; } };
|
struct getRect { Rect operator ()(const CvAvgComp& e) const { return e.rect; } };
|
||||||
struct getNeighbors { int operator ()(const CvAvgComp& e) const { return e.neighbors; } };
|
|
||||||
|
|
||||||
|
|
||||||
bool CascadeClassifier::detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,
|
bool CascadeClassifier::detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,
|
||||||
@ -1093,12 +1092,11 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
|
|||||||
vector<double>& levelWeights,
|
vector<double>& levelWeights,
|
||||||
double scaleFactor, int minNeighbors,
|
double scaleFactor, int minNeighbors,
|
||||||
int flags, Size minObjectSize, Size maxObjectSize,
|
int flags, Size minObjectSize, Size maxObjectSize,
|
||||||
bool outputRejectLevels, bool outputWeights )
|
bool outputRejectLevels )
|
||||||
{
|
{
|
||||||
const double GROUP_EPS = 0.2;
|
const double GROUP_EPS = 0.2;
|
||||||
|
|
||||||
CV_Assert( scaleFactor > 1 && image.depth() == CV_8U );
|
CV_Assert( scaleFactor > 1 && image.depth() == CV_8U );
|
||||||
CV_Assert( !( outputRejectLevels && outputWeights ) );
|
|
||||||
|
|
||||||
if( empty() )
|
if( empty() )
|
||||||
return;
|
return;
|
||||||
@ -1113,12 +1111,6 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
|
|||||||
Seq<CvAvgComp>(_objects).copyTo(vecAvgComp);
|
Seq<CvAvgComp>(_objects).copyTo(vecAvgComp);
|
||||||
objects.resize(vecAvgComp.size());
|
objects.resize(vecAvgComp.size());
|
||||||
std::transform(vecAvgComp.begin(), vecAvgComp.end(), objects.begin(), getRect());
|
std::transform(vecAvgComp.begin(), vecAvgComp.end(), objects.begin(), getRect());
|
||||||
if( outputWeights )
|
|
||||||
{
|
|
||||||
rejectLevels.resize(vecAvgComp.size());
|
|
||||||
std::transform(vecAvgComp.begin(), vecAvgComp.end(), rejectLevels.begin(),
|
|
||||||
getNeighbors());
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1191,10 +1183,6 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
|
|||||||
{
|
{
|
||||||
groupRectangles( objects, rejectLevels, levelWeights, minNeighbors, GROUP_EPS );
|
groupRectangles( objects, rejectLevels, levelWeights, minNeighbors, GROUP_EPS );
|
||||||
}
|
}
|
||||||
else if( outputWeights )
|
|
||||||
{
|
|
||||||
groupRectangles( objects, rejectLevels, minNeighbors, GROUP_EPS );
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
groupRectangles( objects, minNeighbors, GROUP_EPS );
|
groupRectangles( objects, minNeighbors, GROUP_EPS );
|
||||||
@ -1211,16 +1199,6 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
|
|||||||
minNeighbors, flags, minObjectSize, maxObjectSize, false );
|
minNeighbors, flags, minObjectSize, maxObjectSize, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CascadeClassifier::detectMultiScale( const Mat& image, CV_OUT vector<Rect>& objects,
|
|
||||||
vector<int>& weights, double scaleFactor,
|
|
||||||
int minNeighbors, int flags, Size minObjectSize,
|
|
||||||
Size maxObjectSize )
|
|
||||||
{
|
|
||||||
vector<double> fakeLevelWeights;
|
|
||||||
detectMultiScale( image, objects, weights, fakeLevelWeights, scaleFactor,
|
|
||||||
minNeighbors, flags, minObjectSize, maxObjectSize, false, true );
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CascadeClassifier::Data::read(const FileNode &root)
|
bool CascadeClassifier::Data::read(const FileNode &root)
|
||||||
{
|
{
|
||||||
static const float THRESHOLD_EPS = 1e-5f;
|
static const float THRESHOLD_EPS = 1e-5f;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user