Zypps987
Zypps987

Reputation: 414

Opencv Haar Cascade training / detection for simple objects

I am planning on making a cascade detector for a white cup, a red ball, and a blue puck. With how simple these objects are in their shape, I was wondering if there are any parameter differences I will have to have in the training vs finding complex objects such as cars / faces? Also, within the training pos images I have the objects in different lighting conditions and instances where the objects are under shadow.

For training negative images I noticed the image sizes may vary. However, for positive images they MUST be a fixed size.

I plan on using 100x100 pos images to help detect the objects from 20-30 feet, the 200x200 pos images to detect the objects when I am within 5ft / am directly overhead of the object (3 ft off the ground appx). Does this mean that I will have to train 6 different XMLs? 2 for each object as it is trained for 100x100 and 200x200?

Upvotes: 0

Views: 1482

Answers (1)

GPPK
GPPK

Reputation: 6666

Short answer: Yes

Long Answer: Probably:

You have to think about it like this, the classifier is going to build up a set of features for the positive images and then use these to determine whether your detection image is the same or not. If you are drastically moving the angle of your detection, then you are going to need a different classifier.

Let me example with pictures:

If at 20ft away your cup looks like this:

Side On Cup

with associated background/lighting etc, then it is going to be a very different classifier if your cup looks like this(maybe 5ft away but different angle):

Top Down Cup

Now, with all that being said, if you only have larger and smaller versions of your cup, then you may only need one. However you will need a different classifier for each object (cup/ball/puck)


Images not mine - Taken from Google

Upvotes: 1

Related Questions