Hello , I have this image where I have to relate the color of each pixel to some known constant. Let's say, red(including all pixels that are reddish, slightly red, etc.)=STRONG pixels; yellow(in the region of yellow)=WEAKER pixels; and so on… I have to do this for each pixel of my image and the problem I'm having is there are so many possibilities of getting a color somewhat red/reddish/pinkish (with rgb values being different) & all of them must be under the same STRONG pixels category.I've tried coding by taking ranges of values for rgb differenes, but I believe there should be another/clearer way to do so, which won't leave any pixel that is not in the range I've specified. My code is as following:
RedPIXELS='1010-808kPa';YellowPIXELS='700-600kPa';img=imread('1.jpg'); for k=1:vidHeight-1 if img(k,k,1)>250 && img(k,k,1)-img(k,k,2)>100 && img(k,k,1)-img(k,k,3)>100 img(k,k)=RedPIXELS; if img(k,k,2)-img(k,k,1)<50 && img(k,k,3)<10 img(k,k)=YellowPIXELS; end end end
Best Answer