checking background color

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

checking background color

Safaa Al-Haj Saleh
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


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