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.