fixed createsamples info message
authorShresth Verma <vermashresth@gmail.com>
Sun, 3 Dec 2017 21:46:22 +0000 (03:16 +0530)
committerShresth Verma <vermashresth@gmail.com>
Tue, 5 Dec 2017 17:54:22 +0000 (23:24 +0530)
apps/createsamples/utility.cpp

index 2226cd8..c1e5273 100644 (file)
@@ -995,12 +995,12 @@ void icvGetNextFromBackgroundData( CvBackgroundData* data,
         {
             round = data->round;
 
+            data->last = rand() % data->count;
+
 #ifdef CV_VERBOSE
             printf( "Open background image: %s\n", data->filename[data->last] );
 #endif /* CV_VERBOSE */
 
-            data->last = rand() % data->count;
-            data->last %= data->count;
             img = cvLoadImage( data->filename[data->last], 0 );
             if( !img )
                 continue;