[ImageJ-devel] checking background color

Safaa Al-Haj Saleh alhaj.safa at yahoo.com
Mon Apr 14 15:12:43 CDT 2014



Hi all,

I am writing a code to check whether the background of a binary image is black or not. If the background is white, colors of the binary image are inverted (i.e. the color of the background should be always black)

I have done this so far:

ImageProcessor imp = clustering_result.getProcessor();
                  
                  if(Prefs.blackBackground==false){
                  imp.invert();
                  
                  clusteredImage=imp.getBufferedImage();
                  }
                  
                  else {
                  clusteredImage=imp.getBufferedImage();

                  }
                 

But it does not work! Any help please?

Regards,
Safaa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20140414/1525aa89/attachment.html>


More information about the ImageJ-devel mailing list