Created
May 22, 2012 06:09
-
-
Save mokemokechicken/2766974 to your computer and use it in GitHub Desktop.
Patch of apps/traincascade/imagestorage.cpp in OpenCV2.4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- imagestorage.cpp.orig 2012-05-22 06:03:04.257949013 +0000 | |
+++ imagestorage.cpp 2012-05-18 04:03:03.093470949 +0000 | |
@@ -149,15 +149,15 @@ | |
bool CvCascadeImageReader::PosReader::get( Mat &_img ) | |
{ | |
CV_Assert( _img.rows * _img.cols == vecSize ); | |
+ if( feof( file ) || last++ >= count ) | |
+ return false; | |
+ | |
uchar tmp = 0; | |
size_t elements_read = fread( &tmp, sizeof( tmp ), 1, file ); | |
CV_Assert(elements_read == 1); | |
elements_read = fread( vec, sizeof( vec[0] ), vecSize, file ); | |
CV_Assert(elements_read == (size_t)(vecSize)); | |
- if( feof( file ) || last++ >= count ) | |
- return false; | |
- | |
for( int r = 0; r < _img.rows; r++ ) | |
{ | |
for( int c = 0; c < _img.cols; c++ ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment