OpenCV Detecting Traffic Light green signal

asked 2018-05-02 17:18:03 -0600

mssm1996 gravatar image

I'm new to OpenCV Object detection using Cascade Classifier and trying to perform an application that detect green signal of a traffic light.

Downloaded a Dataset containing positive pictures about STOP,GO and WARNING pictures of traffic light (arround 4000 samples for each).

Using pictures where there's green traffic light as positive samples and both red and orange traffic light as negative samples.

My configurations for training: - 20 Stages - numPos 2000 - numNeg 2000 - w 24 - h 24

Got nice result of some pictures and wrong ones from some others (i took in both cases, test picture from the positive examples that i used to train with)

Here's a preview:

Right image Wrong Image

How come such result even thought the second picture belong to used positive examples of training ?

Something else,i have followed as well opencv's tutorial about Cascade Classifier training and programmation, but it doesn't really explain questions like how things work, or how many stages to use, or how many numPos to use etc... so if you have anything that could answer such questions just feed me please...

Thanks in advance.

edit retag flag offensive close merge delete

Comments

using a cascade classifier for this might be a poor choice here. (not enough shape / texture information)

it also ignores color, so all you've left is a dark box with a light blob

then, you missed, that it can only make a binary classification, -- thing or not.

you cannot train it to predict 3 things: green light, red light, or no traffic light at the same time.

berak gravatar imageberak ( 2018-05-03 00:53:37 -0600 )edit

I'm training the detection of 1 thing only => green light so i'm using green light pictures as positive samples and (yellow + red) pictures as negative samples.

If a cascade classifier isn't possible for this purpose, what should i use then ?

mssm1996 gravatar imagemssm1996 ( 2018-05-03 14:30:58 -0600 )edit

do you understand, how a binary classifier works ?

its not green lights vs red lights, it is:

green traffic lights against anything else in this world

(trees, sky, cars, street, you name it)

berak gravatar imageberak ( 2018-05-03 14:43:26 -0600 )edit

sorry to say so, but this won't work, ever.

berak gravatar imageberak ( 2018-05-03 14:46:48 -0600 )edit

I used negative pictures containing a whole environment ( cars + trees + people + sky + buildings ...) , i have same pictures as above that doesn't contain green traffic light that i used for negative samples ! they don't contain ONLY red traffic light x)

mssm1996 gravatar imagemssm1996 ( 2018-05-03 16:14:42 -0600 )edit