Image preparation for haartraining - correct method

asked 2013-11-04 01:02:19 -0600

mswcpt gravatar image

I think the previous question I asked has been forgotten about, so re-posting here:

link to original thread:

My final comment/question relating to this:

Hi - OK - I removed the negative description file from the create samples stage and then did another training session. It went very quickly and the result is even worse - no detection at all. Here is link to terminal output: Please let me know if you see anything strange? If not, perhaps you can assist by telling me a better way to prepare images that I may not be aware of. Thanks in advance.

Please can anyone advise me?

edit retag flag offensive close merge delete


Which are the rest of your parameters?

Pedro Batista gravatar imagePedro Batista ( 2013-11-04 05:11:50 -0600 )edit

The link to the terminal output shows my parameters. Pls have a look and if you see anything strange pls comment. Tks

mswcpt gravatar imagemswcpt ( 2013-11-04 05:57:42 -0600 )edit

I'll give it a look later

Pedro Batista gravatar imagePedro Batista ( 2013-11-04 09:02:56 -0600 )edit

@ Median - have you perhaps had a chance to have a look at the terminal export? Pls let me know - tks!

mswcpt gravatar imagemswcpt ( 2013-11-09 00:36:15 -0600 )edit

I am really not sure what might be wrong. I can tell you that I twisted my nose at your detection window size. I tried to train a non-square detection windowed cascaded classifier but never had success. One thing you could try is to run this command /opencv-createsamples -vec vecfile.vec -show to check if everything is OK with your positive samples in the vecfile. One thing that can be happening is that the positive samples are all twisted and the classifier can achieve the parameters you specified very early in the training, thus ending quickly. Also, are you running a 64-bit version of the haarclassifier? If not, there is no use in setting memory as 4000 RAM, since 32--bit applications only go as far as 2GB.

Pedro Batista gravatar imagePedro Batista ( 2013-11-11 06:18:31 -0600 )edit

Tks for your reply. I have included a link to a screen grab of the bounding box stage in the process to help clarify how I am doing that stage. How does one actually do this for fingers then if you take into consideration what you suggest that it should be "non-square"? Bounding the entire hand would be contrary to my intentions and making a square bounding box seems difficult, unless I create images of only ONE finger?

Opening the .vec file does show each finger as bound in the bounding stage correctly. I hope I don't need to collect 1000's of different finger shots. Here I am using 4 different hands, each filmed for about 20-30s and frames extracted as images.

Think I have 64 Bit version installed - will check later

mswcpt gravatar imagemswcpt ( 2013-11-11 07:52:42 -0600 )edit

Well, obviously a non-square detection window will not work for you. Do one thing: open your task manager before start training the classifier. Then run the command to start training and go to the task manager and check how the memory usage going up. A 70170 detection window probably needs a LOT of memory. I know that a 7070 DW needs around 2 GB.

Pedro Batista gravatar imagePedro Batista ( 2013-11-11 08:08:14 -0600 )edit

It climbed progressively over the last 6 minutes from just under 1 GB usage to 5,45 GB and then stopped climbing, with fluctuation between the upper limit and 5,31 GB so far...

mswcpt gravatar imagemswcpt ( 2013-11-11 08:24:29 -0600 )edit

well, that makes sense, it i weird that the application allows more than 2 GB of RAM, it probably is 64-bit already

Pedro Batista gravatar imagePedro Batista ( 2013-11-11 08:30:42 -0600 )edit

I've left it training now in this session and then will test the classifier's xml output as soon as it is finished and re-post a comment to let you know if the accuracy is different from the previous attempt.

BTW - I checked - it is 64-BIT application

In the meantime, if you can think of any other reason why this was not accurate let me know. Tks

mswcpt gravatar imagemswcpt ( 2013-11-11 08:41:52 -0600 )edit