Commit c4188581 authored by Kirill Kornyakov's avatar Kirill Kornyakov

bug #762 fixed

parent e7f491ae
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <cstring> #include <cstring>
#include <cstdlib> #include <cstdlib>
#include <cmath> #include <cmath>
#include <ctime>
using namespace std; using namespace std;
...@@ -76,6 +77,8 @@ int main( int argc, char* argv[] ) ...@@ -76,6 +77,8 @@ int main( int argc, char* argv[] )
int width = 24; int width = 24;
int height = 24; int height = 24;
srand(time(0));
if( argc == 1 ) if( argc == 1 )
{ {
printf( "Usage: %s\n [-info <collection_file_name>]\n" printf( "Usage: %s\n [-info <collection_file_name>]\n"
......
...@@ -1354,8 +1354,9 @@ void icvGetNextFromBackgroundData( CvBackgroundData* data, ...@@ -1354,8 +1354,9 @@ void icvGetNextFromBackgroundData( CvBackgroundData* data,
// printf( "Open background image: %s\n", data->filename[data->last] ); // printf( "Open background image: %s\n", data->filename[data->last] );
//#endif /* CV_VERBOSE */ //#endif /* CV_VERBOSE */
img = cvLoadImage( data->filename[data->last++], 0 ); data->last = rand() % data->count;
data->last %= data->count; data->last %= data->count;
img = cvLoadImage( data->filename[data->last], 0 );
if( !img ) if( !img )
continue; continue;
data->round += data->last / data->count; data->round += data->last / data->count;
......
...@@ -311,11 +311,10 @@ public: ...@@ -311,11 +311,10 @@ public:
Size minSize=Size(), Size minSize=Size(),
Size maxSize=Size() ); Size maxSize=Size() );
bool isOldFormatCascade() const; bool isOldFormatCascade() const;
virtual Size getOriginalWindowSize() const; virtual Size getOriginalWindowSize() const;
int getFeatureType() const; int getFeatureType() const;
bool setImage(const Mat&); bool setImage( const Mat& );
protected: protected:
virtual bool detectSingleScale( const Mat& image, int stripCount, Size processingRectSize, virtual bool detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,
......
...@@ -872,7 +872,7 @@ Size CascadeClassifier::getOriginalWindowSize() const ...@@ -872,7 +872,7 @@ Size CascadeClassifier::getOriginalWindowSize() const
bool CascadeClassifier::setImage(const Mat& image) bool CascadeClassifier::setImage(const Mat& image)
{ {
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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment