misuse of cvPreprocessIndexArray + FIX (Bug #517)


Added by Vincent Rabaud over 14 years ago. Updated over 14 years ago.


Status:Done Start date:
Priority:High Due date:
Assignee:- % Done:

0%

Category:ml
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

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.


tree.cpp_patch (2.2 kB) Vincent Rabaud, 2010-08-07 01:23 am


Associated revisions

Revision 4cdcf371
Added by Vadim Pisarevsky over 14 years ago

fixed cvPreprocessIndexArray (ticket #517)

Revision dd14dc5d
Added by Maria Dimashova over 14 years ago

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

Also available in: Atom PDF