Login  Register

RGB to HSB question

Posted by yccheok on Jan 14, 2006; 4:24am
URL: http://imagej.273.s1.nabble.com/RGB-to-HSB-question-tp3704068.html

Hello all,

Recently, I try to find out the HSB histogram of an
image using ImageJ.
Since my java code had problem running
HSB_Histogram.txt, where my java
program cannot allocated Color_Histogram.jar although
it had been installed
at /home/yccheok/ImageJ/plugins.

Although I added java class path on
/home/yccheok/ImageJ/plugins/Color_Histogram.jar,
I still having problem in using the
Color_Histogram.jar

Hence, I decide to port over the HSB_Histogram.txt
macro code into java code,
as follow:

           
System.out.println("-->"+IJ.getImage().getBitDepth());
// 24
             IJ.run("HSB Stack");
           
System.out.println("-->"+IJ.getImage().getBitDepth());
// 8
             IJ.run("Convert Stack to RGB");

                        // Although we had converted HSB->RGB, but IJ still
seem
                        // like pointing to HSB. How can we make IJ
pointing to
                        // RGB?
                        //
           
System.out.println("-->"+IJ.getImage().getBitDepth());
// 8

                        // The imagePlus2 is HSB stack. But I would like to
have RGB image.
                        // How I can achieve this?
                        //
             imagePlus2 = IJ.getImage();

Thank you very much!

yccheok

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com