Dear Eva:

        thank you for your help:)

Best
Wei

On 10/5/07, Eva Cernadas Garcia <ecernada@usc.es > wrote:
On Thursday 04 October 2007 14:58, you wrote:
> Dear all:
>
>        I do not know to how to conduct the color space conversion, for
> example, from rgb to hsv, is there any module that can be called?
>
>        many thanks.
>
> Best
> Wei

        Using the function void   vil_colour_space_RGB_to_HSV (T r, T g, T b,
T *h, T *s, T *v), which is define in vil/algo/vil_colour_space.h

        You need a loop


vil_image_view<vxl_byte> rgb;
vil_image_view<float> hsv;
for( unsigned i = 0; i < rgb.ni(); ++i ) {
for( unsigned j = 0; j < rgb.nj(); ++j ) {
vil_colour_space_RGB_to_HSV(
float(rgb(i,j,0)),float(rgb(i,j,1)),float(rgb(i,j,2)),
&hsv(i,j,0), &hsv(i,j,1), &hsv(i,j,2) );
}
}

    Best wishes
          Eva Cernadas