Login  Register

Re: Filtering certain color range

Posted by Sami Badawi-2 on May 13, 2008; 2:27pm
URL: http://imagej.273.s1.nabble.com/Filtering-certain-color-range-tp3696226p3696232.html

Hi again Rasheed,

I got a better look at your image, and I do not think that you can use
a simple color distance filter, since the gray in your image has big
brightness variations. You could make the simple distance filter and
first filter one small gray color area. Save the image and select a
new small gray color and filter that.

Otherwise you could translate each of the RGB pixels to HSB and try to
filter on a interval in that space.

The class java.awt.Color has a method for that:

static float[] RGBtoHSB(int r, int g, int b, float[] hsbvals)

-Sami Badawi
http://www.shapelogic.org