HSB Stack Question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

HSB Stack Question

Lee Berndt
Hello...when I take a section of a raw image and convert it to RGB stack or Lab stack the results are spot on … but when the same section is converted to HSB stack its not even close … for example an RGB of 109,136,104 (Lab of 53, -16, 14) converts mathematically to an HSB of 111.5, 23%, 53% … but with ImageJ saving the same section as an HSB stack and measuring it results in values of 76,74,137 … dividing saturation and brightness by 255 give results reasonably close but how is hue angle derived here? Any suggestions or clarification would be appreciated ….. Thank you in advanced and have a blessed day …. Lee

William L. Berndt, Ph.D.  7133 Penner Lane. Apt. #40Fort Myers, FL 33907@Dr_Lee_Berndt239.246.0396     

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: HSB Stack Question

Herbie
Good day Lee,

I highly recommend that you do the color-space transformation yourself
in a way that results in a 32bit float HSB color stack.

With 8bit stacks you are limited to 255 "hue angles", i.e. colors, in
the H-slice.

Regards

Herbie

::::::::::::::::::::::::::::::::::::::::
Am 10.07.20 um 14:59 schrieb Lee Berndt:
> Hello...when I take a section of a raw image and convert it to RGB stack or Lab stack the results are spot on … but when the same section is converted to HSB stack its not even close … for example an RGB of 109,136,104 (Lab of 53, -16, 14) converts mathematically to an HSB of 111.5, 23%, 53% … but with ImageJ saving the same section as an HSB stack and measuring it results in values of 76,74,137 … dividing saturation and brightness by 255 give results reasonably close but how is hue angle derived here? Any suggestions or clarification would be appreciated ….. Thank you in advanced and have a blessed day …. Lee
>
> William L. Berndt, Ph.D.  7133 Penner Lane. Apt. #40Fort Myers, FL 33907@Dr_Lee_Berndt239.246.0396
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: HSB Stack Question

jmutterer
I find different results with the values you posted, and they are close to
the theoretical results you computed:

 ,Label,                              Mean, Slice,  Range,  Result
1,Untitled:0001-0100-0100:Hue,        78,   1,      360,    110.118
2,Untitled:0001-0100-0100:Saturation, 60,   2,      100,    23.529
3,Untitled:0001-0100-0100:Brightness, 136,  3,      100,    53.333

Here is the macro I used:

newImage("Untitled", "RGB white", 200, 200, 1);
setForegroundColor(109, 136, 104);
run("Select All");
run("Fill", "slice");
run("Select None");
run("HSB Stack");
run("Select All");
roiManager('reset');
roiManager("Add");
run("Set Measurements...", "mean display redirect=None decimal=3");
roiManager("multi-measure measure_all");
ranges = newArray(360,100,100);
for(i=0;i<ranges.length;i++) Table.set("Range",i,ranges[i]);
Table.applyMacro("Result=Range*Mean/255");
Table.update;

Sincerely,
Jerome.


On Fri, 10 Jul 2020 at 15:23, Herbie <[hidden email]> wrote:

> Good day Lee,
>
> I highly recommend that you do the color-space transformation yourself
> in a way that results in a 32bit float HSB color stack.
>
> With 8bit stacks you are limited to 255 "hue angles", i.e. colors, in
> the H-slice.
>
> Regards
>
> Herbie
>
> ::::::::::::::::::::::::::::::::::::::::
> Am 10.07.20 um 14:59 schrieb Lee Berndt:
> > Hello...when I take a section of a raw image and convert it to RGB stack
> or Lab stack the results are spot on … but when the same section is
> converted to HSB stack its not even close … for example an RGB of
> 109,136,104 (Lab of 53, -16, 14) converts mathematically to an HSB of
> 111.5, 23%, 53% … but with ImageJ saving the same section as an HSB stack
> and measuring it results in values of 76,74,137 … dividing saturation and
> brightness by 255 give results reasonably close but how is hue angle
> derived here? Any suggestions or clarification would be appreciated …..
> Thank you in advanced and have a blessed day …. Lee
> >
> > William L. Berndt, Ph.D.  7133 Penner Lane. Apt. #40Fort Myers, FL
> 33907@Dr_Lee_Berndt239.246.0396
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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