a bug in icvCreateBackgroundData function causes opencv_haartraining throwing "Invalid background description file." error (Patch #1676)
Description
The OpenCV 2.3.1 for Unix has a bug in icvCreateBackgroundData function , which could cause the error "Invalid background description file."
the end of data->filename[count] string is "\r\n" which would make the cvLoadImage(data->filename[count], 0) return null to IplImage *
change code in icvCreateBackgroundData function /OpenCV-2.3.1/modules/haartraining/cvhaartraining.cpp
if( len > 0 && imgfilename[len-1] == '\n' ) imgfilename[len-1] = 0, len--;
to
if( len > 0 && imgfilename[len-1] == '\n' )
{
imgfilename[len-1] = '\0', len--;
imgfilename[len-1] = '\0';
}
could make the opencv_haartraining do well
Associated revisions
fixed "Invalid background description file" bug, #1676
Merge pull request #1676 from ilya-lavrenov:ocl_resize_test
History
Updated by Alexander Shishkov almost 13 years ago
- Tracker changed from Bug to Patch
- Target version deleted ()
- Category set to objdetect
Updated by Vadim Pisarevsky almost 13 years ago
thanks! the problem has been fixed in SVN trunk, r7632
- Status changed from Open to Done
- Assignee set to Vadim Pisarevsky
Updated by Alexander Shishkov almost 13 years ago
- Target version set to 2.4.0