Ask Your Question
1

How to detect the Licence plate?

asked 2016-02-28 23:30:28 -0600

zshn25 gravatar image

I am trying to detect the number plate in an image. Usually licence plates in my country are black texts with white or yellow background. So, I detect these colors from an image. But my algo gives me everything except the licence plate. The code I used is

Mat img_hsv;
cvtColor(input_image, img_hsv, CV_BGR2HSV);

Mat img_yellow;
int lowerHue = 22;  //For yellow
int upperHue = 38;
inRange(img_hsv, Scalar(lowerHue, 100, 100), Scalar(upperHue, 255, 255), img_yellow);

Mat img_white;
inRange(img_hsv, Scalar(0, 0, 200), Scalar(255, 55, 255), img_white);

Mat img_black;
inRange(img_hsv, Scalar(0, 0, 0), Scalar(255, 55, 50), img_black);

Mat mask = img_black + img_white + img_yellow;
Mat img_result;
bitwise_and(input_image, input_image, img_result, mask);

and the result is image description

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-03-17 07:12:59 -0600

zshn25 gravatar image

Turns out, the number plate is not actually white. I tuned the HSV parameters a little bit and it worked.

Also, this is not a reliable method for detecting number plates. Since, it changes from image to image.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-02-28 23:30:28 -0600

Seen: 1,213 times

Last updated: Mar 17 '16