Login  Register

Re: Set color threshold

Posted by Peter Haub on Nov 05, 2015; 3:09pm
URL: http://imagej.273.s1.nabble.com/Set-color-threshold-tp5014850p5014870.html

Hi David,

there is no such command for color images in ImageJ. Thresholding color
images is more complex.

In your situation (Task: select value 255/255/0 where others can only be
0/255/0 or 255/0/0) I would prefer to create a gray scale image and work
on this.
Use
         ImageProcessor ip2 = imp.getProcessor().convertToByteProcessor();
         ImagePlus imp2 = new ImagePlus("Gray", ip2);
to create a 8bit image with the weights wR/wG/wB = 1/1/1.

Regards,
Peter

On 05.11.2015 11:32, davek604 wrote:

> Hello
> I am writing a plugin where I have an image that has been constructed from 2
> binary masks. The masks were coloured green (000,255,00) and red
> (255,000,000) so where there is overlap I get yellow (255,255,000) I want to
> automatically set the RGB threshold to select the yellow but I can find no
> command in the API for doing this on colour images. For grey scale I use the
> command IJ.setThreshold(imp,lowThresholdValue,HighThresholdValue)
> Unfortunately I can't find a colour version of this command. Any help
> greatly appreciated.
>
> Regards
>
> David
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Set-color-threshold-tp5014850.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html