anyone know how to recognize skin color in java~ do help me~very urgent~
Now, more than one week after your post, I'd like to mention that when I pointed you to this thread, I meant you should read it rather than post in it. Considering the age of the thread, I think it's unlikely that the members who wrote it are still monitoring it, at least not on a regular basis.
Didn't reading the thread give you any useful information?
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Just use the code posted in this thread to discriminate between the two regions as black and white. Then go through all the pixels, and identify border pixels -- they are the ones that aren't surrounded by same-color pixels. At the same time group all border pixels that are adjacent to each other together, and you'll have a list of groups of pixels which is a list of outlines around each region.
I know this is an old thread and the topic seems to have shifted a little from the original question... but as I'm about to ask a question myself, I thought I'd just to go back to the original question in this thread ("How can I find the green pixels in my image?") as I didn't see a few possibly relevant things touched on in here and contribute first.
There's actually three things at play..
1. The method of determining which colors are green
2. Specifying what, exactly, 'green' is.
3. What color system you're using (ignoring that one in this post)
Is #00ff00 green?
What about #00cc00?
If you're looking just for those 'pure green' colors, then a bitmask will do.
Is #10ff00 green?
If you're looking for colors that are close enough to a pure green, then a hue lookup (either through conversion to HSV/HSL or not) with a threshold will do.
Now for a less simple example...
Is #8db600 or is #27a64c green (#00ff00)?
Conventional wisdom from looking at the numbers would indicate that the first is more of a yellow and the second is more of a green.
Looking at the hues for the first one, it is 73.5°.
For the second one, 137.5°.
In terms of hue, the second one -also- appears to be more green (120°, while the first appears to be quite a bit more yellow (60°.
Yet if you put all three colors up on your screen, odds are you'll find the first one to match the pure bright green more than the second one.
The reason for this is that human perception doesn't work like HSV/HSL space - it also doesn't work particularly like L*a*b space when it comes to comparing two colors (where one might take the euclidean distance).
It's actually a question that is answered ever-refinedly and the algorithms that try to give the answers in color difference are all shared under the nomer "Delta E". http://en.wikipedia.org/Color_difference
Once you implement any of those algorithms (I suggest CMC 1:1 - it's fairly accurate without the heavy calculation and coding impact of CIEDE2000), you'll also quickly find that while both #00ff00 and #008000 are green, the range of similar colors varies wildly between these two along traditional hue axes and the like.. so you have to specify what 'green' is for such an algorithm to tell you what other colors in the image are similar to that 'green'.
I have used nearest neighbor classification in l*a*b space color in order to separate Blue object and Green object in an image.
Classification give me two RGB images.I want to detect which one is blue and which one is Green.
I wrote this code in matlab:
[y1 y2]=classify_im(RGBimage); %This function return two RGB images after classification
if (mean(mean(y1(:,:,2))) > mean(mean(y1(:,:,3)))) && (mean(mean(y1(:,:,2))) > mean(mean(y2(:,:,2))))
But In some condition, it does not detect correctly...
Can anyone help me?