Skip to content

Commit

Permalink
fixed vector out of range exception in nextImg
Browse files Browse the repository at this point in the history
  • Loading branch information
wichersn committed May 18, 2015
1 parent 354ed5c commit 5cb70d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/traincascade/imagestorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ bool CvCascadeImageReader::NegReader::nextImg()
for( size_t i = 0; i < count; i++ )
{
src = imread( imgFilenames[last++], 0 );
if( src.empty() )
if( src.empty() ){
last %= count;
continue;
}
round += last / count;
round = round % (winSize.width * winSize.height);
last %= count;
Expand Down

0 comments on commit 5cb70d3

Please sign in to comment.