1

I am doing a Matlab program to recognize traffic road signs. I have different photos with road signs and the program must recognize what sign is it. However I get difficulties with color recognition because the photos don't have the same contrast. I want on each picture to keep the red and the blue of the signs, and put the other colors in black. Therefore it is impossible to do conditions like :

if im(i,j,1) > 0.28 & im(i,j,2) < 0.25 & im(i,j,3) < 0.25 %Red

  im(i,j,1) = 1 ;
  im(i,j,2) =  0;
  im(i,j,3) = 0;

Because there are too many red or blue shades if we take all the images.

Do you know how to handle with the different contrasts in the images ?

Thank in advance.

Whatzat
  • 81
  • 6
  • 2
    I've answered another question with a similar problem and suggested converting the image to HSV. Take a look, maybe it works for you. http://stackoverflow.com/questions/23252114/object-detecting-using-thresholding/23252800#23252800 – Rafael Monteiro May 06 '14 at 12:51
  • @RafaelMonteiro Hi, sorry for my late answer. I tried your method, however the result seems unusable because red isn't isolate correctly, imshow(imgHSV(:,:,1)) gives me a B&W image instead of a colored one. I put some screens to give you an idea : http://hpics.li/30bd742 http://hpics.li/e0271a1 http://hpics.li/6cd0f36 Thanks for your help – Whatzat May 09 '14 at 16:21
  • Look at my answer there again. After `imshow` I called `colormap('hsv')` to map the gray values to color values (for display only). Read the answer carefully and try to apply that, step by step. – Rafael Monteiro May 09 '14 at 19:17

0 Answers0