[Insight-users] Separating saturation from RGB image

Dan Mueller dan.muel at gmail.com
Mon Feb 21 11:19:21 EST 2011


Hi Pitor,

You may also be interested in the following contribution to the Insight Journal:
    "RGB Image Color Space Transformations"
    http://www.insight-journal.org/browse/publication/780

HTH

Cheers, Dan

On 21 February 2011 13:13, Piotr Majkrzak <petrol.91 at gmail.com> wrote:
> Dear all,
> I'm writing to you because i have a problem with ITK library. It's my first
> program with it.
> I don't know how to use ITK to separate saturation layer of RGB image.
> My function:
> double Sat(itk::RGBPixel<uint8_t> & RGB)
> {
>   return static_cast<double>(std::max(RGB[0],std::max(RGB[1],RGB[2])) -
> std::min(RGB[0],std::min(RGB[1],RGB[2]))) /
> static_cast<double>(std::max(RGB[0],std::max(RGB[1],RGB[2])));
> }
> is good for one pixel, but I don't know how to apply it for all pixels and
> create new image.
> Yours sincerely
> Piotr Majkrzak


More information about the Insight-users mailing list