opencv_performance return error well trained data with opencv_traincascade

asked 2015-04-10 07:43:32 -0600

OrkunK gravatar image

updated 2015-04-14 16:17:34 -0600

I'm trying to detect objects and I created 241 samples with opencv_createsamples.exe -info D:\res\p\p.txt -vec D:\res\p\p.vec -w 50 -h 20 -num 241 it's output was successful and then did train process with opencv_traincascade.exe -data D:\Cascade -vec D:\res\p\p.vec -bg D:\res\bg\bg.txt -mode ALL -w 50 -h 20 -numPos 215 -numNeg 530 and also it finished well to. But when I try to test performance the trained data with opencv_performance.exe -data D:\Cascade\cascade-haar-20stages-215samples.xml -d D:\res\test\test.txt -w 50 -h 20, it is returning OpenCV Error: Unspecified error (size node is not a valid sequence.) in icvReadHaarClassifier, file C:\opencv\sources\modules\objdetec\src\haar.cpp, line 2072. I've looked the lines but I didn't understand anything. I'm using OpenCV-2.4.9 compiled with Visual Studio 2012 on Windows 7 64-bit. Now I'm creating old-style data set with opencv_haartraining.exe but it's still at 16th-stage at 0% since 7 hours. But I want to know why the new classifier is giving this error?

Edit: it has finished with 3 days but it didn't enough for recognition. Now I've changed positive samples size, which I added 5 pixels for each side of image because it's a rectangular object and I've created positive samples with it's borders (not any background) so normally I didn't find any object with that dataset. Now with creating new dataset with backrounds, I've faced with something I don't know, which is listing something in a table and it's on 82445th place and it's style is i.e.

    .
    .
    .
    +----+----+-+---------+---------+---------+---------+
    |82647|  1%|-|-13908.888672| 0.995349| 0.775472| 0.224161|
    +----+----+-+---------+---------+---------+---------+
    |82648|  1%|+|-13909.888672| 0.995349| 0.775472| 0.224161|
    +----+----+-+---------+---------+---------+---------+
    |82649|  2%|+|-13910.888672| 0.995349| 0.775472| 0.224161|
    +----+----+-+---------+---------+---------+---------+
    |82650|  0%|+|-13911.835938| 0.995349| 0.775472| 0.224161|
    +----+----+-+---------+---------+---------+---------+
    |82651|  0%|-|-13912.835938| 0.995349| 0.775472| 0.224161|
    +----+----+-+---------+---------+---------+---------+
    .
    .
    .

what is it mean?

edit retag flag offensive close merge delete

Comments

Some remarks

  • opencv_performance indeed only works on HAAR based classifiers and ONLY if they are trained with the old haartraining interface. Up till now there has been noone that took up the job to translating it for the traincascade app.
  • However the haartraining is outdated, contains bugs and is known to get stuck. In that case I suggest people to use the traincascade app ...
  • However keep in mind that the haartraining hasn't been update in years, so it being stuck for 7 hours doesnt mean a thing, let it stay on for lets say 24 hours first.
StevenPuttemans gravatar imageStevenPuttemans ( 2015-04-10 07:54:47 -0600 )edit
1

Thanks for the quick comment. This mean we can test the trained data just with our code which is contain detection process. And also we have to write our appropriate small performance tester app or just watch the results. Can we use the sample face detection algorithm for any other object detection purpose with new type of classifiers (HAAR, LBP or HOG)? Or must we write detection code for new one?

OrkunK gravatar imageOrkunK ( 2015-04-10 08:16:50 -0600 )edit

Yeah all samples and interfaces available have been made compatible with the new type of cascades. So go ahead with the sample code. As to the evaluation/performance software, indeed you will have to make your own :)

StevenPuttemans gravatar imageStevenPuttemans ( 2015-04-10 08:21:58 -0600 )edit

Thank you.

OrkunK gravatar imageOrkunK ( 2015-04-10 08:28:49 -0600 )edit

@OrkunK please stop using the haartraining interface but use the traincascade interface instead. It contains way better error handling/capturing and will tell us better what is going wrong...

StevenPuttemans gravatar imageStevenPuttemans ( 2015-04-15 07:01:16 -0600 )edit
1

Ok I'll do

OrkunK gravatar imageOrkunK ( 2015-04-15 14:24:19 -0600 )edit