Ask Your Question

wolfgang's profile - activity

2012-11-04 09:42:40 -0600 commented question Why always OpenCV Error: Assertion failed (elements_read == 1) in unknown function ?

Just a question: Why has this been voted negatively?

2012-11-04 09:42:00 -0600 received badge  Supporter (source)
2012-11-04 05:00:11 -0600 commented question Why always OpenCV Error: Assertion failed (elements_read == 1) in unknown function ?

I suspect the problem is some intricacy with eof. To be honest, currently I am more of a JAVA person and in my former c++ life I have rarely used eof. I preferred using file formats with announced lengths. So, please wish me luck ;-). I will post my findings when I have a fix.

2012-11-04 04:59:23 -0600 commented question Why always OpenCV Error: Assertion failed (elements_read == 1) in unknown function ?

Hi all, I have no answer yet, but your question and its answers strengthens my view that relatively in recent refactoring an error was introduced in the vector file reading procedure. Actually, the writing procedure icvWriteVecSample writes a null char before each vec sample written. The assert that fails checks for this null. It is called from within a for(;;) loop that breaks only if an eof is found. However, somehow the eof never occurs (at my place, a mac using macports) before the assert is being thrown.

I already added a null char to the end of my .vec file in order to check if things run through if there is a 0 in the end. The answer is "no".

Having read your post i am inclined to fix icvGetHaarTraininDataFromVecCallback so that it reads vectors correctly. I suspect the problem is

2012-11-04 04:58:16 -0600 answered a question Why always OpenCV Error: Assertion failed (elements_read == 1) in unknown function ?

Hi all, I have no answer yet, but your question and its answers strengthens my view that relatively in recent refactoring an error was introduced in the vector file reading procedure. Actually, the writing procedure icvWriteVecSample writes a null char before each vec sample written. The assert that fails checks for this null. It is called from within a for(;;) loop that breaks only if an eof is found. However, somehow the eof never occurs (at my place, a mac using macports) before the assert is being thrown.

I already added a null char to the end of my .vec file in order to check if things run through if there is a 0 in the end. The answer is "no".

Having read your post i am inclined to fix icvGetHaarTraininDataFromVecCallback so that it reads vectors correctly. I suspect the problem is some intricacy with eof. To be honest, currently I am more of a JAVA person and in my former c++ life I have rarely used eof. I preferred using file formats with announced lengths. So, please wish me luck ;-). I will post my findings when I have a fix.