haarcascade finger-tip detection and image prep [closed]

asked 2014-02-26 13:31:21 -0600

mswcpt gravatar image

updated 2014-02-26 13:40:12 -0600

berak gravatar image

I am trying to create a haarcascade to detect finger tips. I have recorded two hands in HD videos each 20 seconds in length. Then extracted the BMP images in a set of positive images. The images are from the top of the hand with the finger nails showing and the bounding boxes created around each finger tip with the nail - 4 per hand. After running a bounding box .cpp app to use createsamples then ran a training session for 10 hours where it completed 4 stages out of designated 10 and terminated.

I am baffled as to why it terminated when I have a set of over 1500 pos images and nearly 2000 negative images of random pictures.

Testing detection of the finger tip was a failure - no detection of the objects bounded.

Advice? Thank you!

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-12-09 03:56:02.140747

Comments

1)The number of negative images must be greater than twice the number of positive images. 2)Try to set numPos = 0.9 * number_of_positive_samples and 0.99 as a minHitRate. 3)vec-file has to contain >= (numPose + (numStages-1) * (1 - minHitRate) * numPose) + S, where S is a count of samples from vec-file.S is a count of samples from vec-file that can be recognized as background right away. 4)Allocate enough nonsysm memory space of atleast 512mb 5)The haarcascade process sometimes takes a week to get completed if kept totally unaltered.So,be patient,u may try using less number of stages for trials

Abhishek Kumar Annamraju gravatar imageAbhishek Kumar Annamraju ( 2014-02-26 13:52:04 -0600 )edit

Thanks for the info/advice - will try this. In meantime, what is your thoughts about using two videos of hands i.e. two sets of positive images? Do you think I should film more hands? Will this make a difference in this case?

mswcpt gravatar imagemswcpt ( 2014-02-26 13:55:39 -0600 )edit

Diversity in positive images helps to train in a better way.But again the time required for a good decent training has always been a mystery to me.Sometimes it takes a day,sometimes a week,sometimes it just hangs up with no further progress.

Abhishek Kumar Annamraju gravatar imageAbhishek Kumar Annamraju ( 2014-02-26 14:04:52 -0600 )edit

Thanks I understand that. The question is though - what limit should one impose in the image collection process - should you have only 10 or 1000 images of the same hand?

mswcpt gravatar imagemswcpt ( 2014-02-26 14:07:24 -0600 )edit

I would prefer less number of images (between 50 to 100) of same hand.

Abhishek Kumar Annamraju gravatar imageAbhishek Kumar Annamraju ( 2014-02-26 14:13:43 -0600 )edit

cool - I'll collect as many hands as possible, and let you know how I get on.

mswcpt gravatar imagemswcpt ( 2014-02-26 14:18:08 -0600 )edit

Hi again - it has been a few weeks. I have collected many hands and extracted the images. Attempted several training sessions - and failed. I need to ask:

  1. You say above " s is a count of samples from vec-file that can be recognized as background right away." What do you mean by this? That some of the positive samples should be images where the detection is going to take place - i.e. if I want to detect fingers on a desk, then I must have positive samples of fingers on a desk?
  2. I'm a bit confused by your math operations in the equation above - clarify?
  3. train cascade using haar took very long - eventually I had to abort after 10 days training and reaching stage 3 only... very strange. Any ideas?
  4. Perhaps you can look at the image sample set? Thanks again for your help.
mswcpt gravatar imagemswcpt ( 2014-04-16 08:41:13 -0600 )edit