a bug in icvCreateBackgroundData function causes opencv_haartraining throwing "Invalid background description file." error (Patch #1676)


Added by 林 陈 almost 14 years ago. Updated almost 13 years ago.


Status:Done Start date:2012-03-12
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:objdetect
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

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

Revision f341ce26
Added by Vadim Pisarevsky almost 13 years ago

fixed "Invalid background description file" bug, #1676

Revision 2279c209
Added by Andrey Pavlenko over 11 years ago

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

Also available in: Atom PDF