The bug was fixed
This commit is contained in:
parent
e9a5bbc003
commit
537a36115f
@ -347,9 +347,16 @@ public:
|
|||||||
double scaleFactor=1.1,
|
double scaleFactor=1.1,
|
||||||
int minNeighbors=3, int flags=0,
|
int minNeighbors=3, int flags=0,
|
||||||
Size minSize=Size(),
|
Size minSize=Size(),
|
||||||
|
Size maxSize=Size() );
|
||||||
|
|
||||||
|
CV_WRAP virtual void detectMultiScale( const Mat& image,
|
||||||
|
CV_OUT vector<Rect>& objects,
|
||||||
|
vector<int>& rejectLevels,
|
||||||
|
double scaleFactor=1.1,
|
||||||
|
int minNeighbors=3, int flags=0,
|
||||||
|
Size minSize=Size(),
|
||||||
Size maxSize=Size(),
|
Size maxSize=Size(),
|
||||||
bool outputRejectLevels = false,
|
bool outputRejectLevels = false );
|
||||||
vector<int>& rejectLevels = vector<int>(0));
|
|
||||||
|
|
||||||
|
|
||||||
bool isOldFormatCascade() const;
|
bool isOldFormatCascade() const;
|
||||||
@ -358,9 +365,12 @@ public:
|
|||||||
bool setImage( const Mat& );
|
bool setImage( const Mat& );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
//virtual bool detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,
|
||||||
|
// int stripSize, int yStep, double factor, vector<Rect>& candidates );
|
||||||
|
|
||||||
virtual bool detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,
|
virtual bool detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,
|
||||||
int stripSize, int yStep, double factor, vector<Rect>& candidates,
|
int stripSize, int yStep, double factor, vector<Rect>& candidates,
|
||||||
bool outputRejectLevels = false, vector<int>& rejectLevels = vector<int>(0) );
|
vector<int>& rejectLevels, bool outputRejectLevels = false);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum { BOOST = 0 };
|
enum { BOOST = 0 };
|
||||||
|
@ -926,7 +926,7 @@ struct getRect { Rect operator ()(const CvAvgComp& e) const { return e.rect; } }
|
|||||||
|
|
||||||
bool CascadeClassifier::detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,
|
bool CascadeClassifier::detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,
|
||||||
int stripSize, int yStep, double factor, vector<Rect>& candidates,
|
int stripSize, int yStep, double factor, vector<Rect>& candidates,
|
||||||
bool outputRejectLevels, vector<int>& levels )
|
vector<int>& levels, bool outputRejectLevels )
|
||||||
{
|
{
|
||||||
if( !featureEvaluator->setImage( image, data.origWinSize ) )
|
if( !featureEvaluator->setImage( image, data.origWinSize ) )
|
||||||
return false;
|
return false;
|
||||||
@ -949,6 +949,14 @@ bool CascadeClassifier::detectSingleScale( const Mat& image, int stripCount, Siz
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//bool CascadeClassifier::detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,
|
||||||
|
// int stripSize, int yStep, double factor, vector<Rect>& candidates )
|
||||||
|
//{
|
||||||
|
// vector<int> fakeLevels;
|
||||||
|
// return detectSingleScale( image, stripCount, processingRectSize,
|
||||||
|
// stripSize, yStep, factor, candidates, fakeLevels, false );
|
||||||
|
//}
|
||||||
|
|
||||||
bool CascadeClassifier::isOldFormatCascade() const
|
bool CascadeClassifier::isOldFormatCascade() const
|
||||||
{
|
{
|
||||||
return !oldCascade.empty();
|
return !oldCascade.empty();
|
||||||
@ -969,10 +977,11 @@ bool CascadeClassifier::setImage(const Mat& image)
|
|||||||
return featureEvaluator->setImage(image, data.origWinSize);
|
return featureEvaluator->setImage(image, data.origWinSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects,
|
void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects,
|
||||||
|
vector<int>& rejectLevels,
|
||||||
double scaleFactor, int minNeighbors,
|
double scaleFactor, int minNeighbors,
|
||||||
int flags, Size minObjectSize, Size maxObjectSize,
|
int flags, Size minObjectSize, Size maxObjectSize,
|
||||||
bool outputRejectLevels, vector<int>& rejectLevels )
|
bool outputRejectLevels )
|
||||||
{
|
{
|
||||||
const double GROUP_EPS = 0.2;
|
const double GROUP_EPS = 0.2;
|
||||||
|
|
||||||
@ -1042,7 +1051,7 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( !detectSingleScale( scaledImage, stripCount, processingRectSize, stripSize, yStep, factor, candidates,
|
if( !detectSingleScale( scaledImage, stripCount, processingRectSize, stripSize, yStep, factor, candidates,
|
||||||
outputRejectLevels, rejectLevels ) )
|
rejectLevels, outputRejectLevels ) )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1051,6 +1060,15 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
|
|||||||
|
|
||||||
|
|
||||||
groupRectangles( objects, rejectLevels, minNeighbors, GROUP_EPS );
|
groupRectangles( objects, rejectLevels, minNeighbors, GROUP_EPS );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects,
|
||||||
|
double scaleFactor, int minNeighbors,
|
||||||
|
int flags, Size minObjectSize, Size maxObjectSize)
|
||||||
|
{
|
||||||
|
vector<int> fakeLevels;
|
||||||
|
detectMultiScale( image, objects, fakeLevels, scaleFactor,
|
||||||
|
minNeighbors, flags, minObjectSize, maxObjectSize, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CascadeClassifier::Data::read(const FileNode &root)
|
bool CascadeClassifier::Data::read(const FileNode &root)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user