From: Walter Roberson on 28 Apr 2010 11:22 David Young wrote: > >> but my yellow dissapears if i do this, it normally should be all >> black, as all the color should be 1 in binary, thats what my teacher >> told me any way, >> please help me to find my mistakes, i am totally lost. > > "All the color should be 1 in binary" is hard to understand. Can you > explain more clearly? And why is yellow special? The conversion to grey > scale that you do right after reading the image treats all colours equally. My parsing of this is that after conversion to a luminance image (grayscale), the yellow portion is falling below the luminance threshold that the original poster is using, and so is being converted to 0 when the matrix is binarized. And that the original poster did not expect this, because the poster's teacher seems to have indicated to the poster that all of the color portions of the original image should come out as 1's. Which, of course, is wrong, since the thresholding is based on brightness, not on hue, and with the luminance conversion factors used, any color that contains green at less than 85% full strength cannot reach a luminance of more than 1/2 the maximum. http://www.mathworks.com/access/helpdesk/help/toolbox/images/rgb2gray.html
From: David Young on 28 Apr 2010 17:39 Walter, yes that sounds likely. So the initial advice might just be: try experimenting with the threshold.
From: Walter Roberson on 28 Apr 2010 18:04 Walter Roberson wrote: > Which, of course, is wrong, since the thresholding is based on > brightness, not on hue, and with the luminance conversion factors used, > any color that contains green at less than 85% full strength cannot > reach a luminance of more than 1/2 the maximum. > http://www.mathworks.com/access/helpdesk/help/toolbox/images/rgb2gray.html Re-thinking that, I realize the last bit about 85% green needed to reach 1/2 maximum luminance is wrong. I should have thought more clearly: since the factors are linear, a*(1/2*R) + b*(1/2*G) + c*(1/2*B) = 1/2*(a*R+b*G+c*G) and thus an image that was "half-white" (e.g., [128, 128, 128] would have a luminance of 1/2 even though the G component was less than 85% of maximum green. Bright yellow is composed of full Red and full Green and no Blue -- but a darker yellow or a shade of yellow wouldn't take all that much to have a notably lower luminance.
From: Ish Khan on 28 Apr 2010 21:40 Walter Roberson <roberson(a)hushmail.com> wrote in message <hr9jqv$qsn$1(a)canopus.cc.umanitoba.ca>... > David Young wrote: > > > >> but my yellow dissapears if i do this, it normally should be all > >> black, as all the color should be 1 in binary, thats what my teacher > >> told me any way, > >> please help me to find my mistakes, i am totally lost. > > > > "All the color should be 1 in binary" is hard to understand. Can you > > explain more clearly? And why is yellow special? The conversion to grey > > scale that you do right after reading the image treats all colours equally. > > My parsing of this is that after conversion to a luminance image > (grayscale), the yellow portion is falling below the luminance threshold > that the original poster is using, and so is being converted to 0 when > the matrix is binarized. > > And that the original poster did not expect this, because the poster's > teacher seems to have indicated to the poster that all of the color > portions of the original image should come out as 1's. > > Which, of course, is wrong, since the thresholding is based on > brightness, not on hue, and with the luminance conversion factors used, > any color that contains green at less than 85% full strength cannot > reach a luminance of more than 1/2 the maximum. > http://www.mathworks.com/access/helpdesk/help/toolbox/images/rgb2gray.html Hi Walter, thanks for the reply. Actually, what you said was correct, my yellow is turning white and not black, which should be a 1 as it is a color. Now my teacher asking me to see the problem in this way, as white is 255, anything below the 255 mark should be a 1, anything equal should be a 0, so if i program it in that way that anything of the value of 255 is white thus 0 and anything below 255 is black thus 1, my problem is solved, but i don't know how to do that, any suggestion?
From: ImageAnalyst on 28 Apr 2010 22:00 On Apr 28, 9:40 pm, "Ish Khan" <smitten...(a)yahoo.com> wrote: > Hi Walter, thanks for the reply. Actually, what you said was correct, my yellow is turning white and not black, which should be a 1 as it is a color.. Now my teacher asking me to see the problem in this way, as white is 255, anything below the 255 mark should be a 1, anything equal should be a 0, so if i program it in that way that anything of the value of 255 is white thus 0 and anything below 255 is black thus 1, my problem is solved, but i don't know how to do that, any suggestion? -------------------------------------------------------------------------------------------- Ish: To me this is still confusing because you're talking about monochrome values like 0, 1, and 255, while Walter is talking about a color image with three values, like [230, 240, 20] which would be sort of a yellow color. And frankly, I'm still puzzled as to why 1. you never did try my color detection code which could easily be adapted to find yellow color (instead of red) and make a binary mask, and 2. why you're refusing to post your (possibly color) "foot" image so we can take a look at it. It's like you don't want to help yourself, or even enable us to help you. Baffled, ImageAnalyst
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Copy excel infomration using matlab Next: Manually changing variable while running a loop |