misuse of cvPreprocessIndexArray + FIX (Bug #517)
Description
cvPreprocessIndexArray can return a null pointer if the vectors of indexers contain only 1's (This is the condition
if( idx_selected == idx_total )
EXIT;
in cvPreprocessIndexArray in inner_functions.cpp)
Nonetheless, those cases are not treated properly in tree.cpp and make the code crash. The patch fixes that.
Associated revisions
fixed cvPreprocessIndexArray (ticket #517)
fixed #517; uncommented ertrees test and moved it to black llist
History
Updated by Vadim Pisarevsky over 14 years ago
thanks! Since cvPreprocessIndexArray is used by the other stat. models, not only the decision trees, it's safer to fix the root cause of the problem - the mentioned condition in the cvPreprocessIndexArray. It has been commented off in r3879.
- Status changed from Open to Done
- (deleted custom field) set to fixed
Updated by Kirill Kornyakov over 14 years ago
r3879 breaks cascade training. opencv_traincascade and opencv_haartraining don't work with these two lines commented (see r3879). If I run current trunk version, application finished with exception and the output is following:
h5. TRAINING 0-stage <BEGIN POS count : consumed 3000 : 3000 NEG count : acceptanceRatio 1500 : 1 Precalculation time: 2 +----+---------+---------+ | N | HR | FA | +----+---------+---------+ | 1| 1| 1| +----+---------+---------+ | 2| 1| 1| +----+---------+---------+ .... +----+---------+---------+ | 99| 1| 1| +----+---------+---------+ | 100| 1| 1| +----+---------+---------+ END> [[OpenCV]] Error: Assertion failed (tempNode->left) in write, file /home/kir/work/ros_opencv_trunk/opencv/modules/traincascade/boost.cpp, line 616 terminate called after throwing an instance of 'cv::Exception' what(): /home/kir/work/ros_opencv_trunk/opencv/modules/traincascade/boost.cpp:616: error: (-215) tempNode->left in function write ./scripts/trainCascade.sh: line 17: 23355 Aborted $cmd
But if I uncomment these two lines, everything is OK:
h5. TRAINING 0-stage <BEGIN POS count : consumed 3000 : 3000 NEG count : acceptanceRatio 1500 : 1 Precalculation time: 3 +----+---------+---------+ | N | HR | FA | +----+---------+---------+ | 1| 1| 1| +----+---------+---------+ | 2| 0.996667| 0.389333| +----+---------+---------+ END>
- Status changed from Done to Cancelled
- (deleted custom field) deleted (
fixed)
Updated by Maria Dimashova over 14 years ago
Fixed in 4102.
- Status changed from Cancelled to Done
- (deleted custom field) set to fixed