-2

(C#, EmguCV) I've developed anpr for black background white foreground plate license number. But i'm stack for red background plate. im using preprocessing like grayscale and otsu threshold and contour morphology for detect characters. But for red plate, the threshold's result is white area (fig.2) so the characters are missed. Any helps?

Black bg plate number detection

Red plate number: threshold result

2 Answers2

1

No idea what software/hardware you're using but just a though: when you look at red through another primary color filter (say green) it comes out black right, whereas the white text would become green. (Also the black through the green filter stays black, again the white text becomes green.)

Rob
  • 444
  • 3
  • 10
0

Since you are collecting candidates, try to split an image into its layers, so you get a gray scale image for red, green and blue. On the red image the plate should be fully white ( because it is a grayscale image and the more red it was the more white it now bekomes) but on the green and blue one the plate should be black or dark green with white numbers and characters.

enter image description here

Like the image shows, blue and green are just fitting your needs, while red hosts a white rectangle (usbale for a faster detection of candidates)

Mat and Image holds some nice methods for that; it should help:

Mat[] Split(); // from Mat
TDepth[,,] Data; // from Image<TColor, TDepth> or even better:
Image<Gray, TDepth>[] Split(); // from Image<TColor, TDepth> too
CvInvoke.EqualizeHist( inGray, betterGray); // would enhance images with low light

Just check how many channels your image has and check every one of them.

Ryugeist
  • 103
  • 9