/// <summary> /// Converts the source color to the destination color. /// </summary> /// <param name="image">Source image.</param> /// <returns>image with converted color.</returns> public static Bgr <byte>[,] ToBgr(this Hsv <byte>[,] image) { return(image.Convert <Hsv <byte>, Bgr <byte> >(Hsv <byte> .Convert)); }
/// <summary> /// Converts the source color to the destination color. /// </summary> /// <param name="image">Source image.</param> /// <param name="area">Working area.</param> /// <returns>image with converted color.</returns> public static Bgr <byte>[,] ToGray(this Hsv <byte>[,] image, Rectangle area) { return(image.Convert <Hsv <byte>, Bgr <byte> >(Hsv <byte> .Convert, area)); }
/// <summary> /// Converts the source channel depth to the destination channel depth. /// </summary> /// <typeparam name="TDepth">Destination channel depth.</typeparam> /// <param name="image">Image.</param> /// <returns>Image with converted element depth.</returns> public static Hsv <TDepth>[,] Cast <TDepth>(this Hsv <double>[,] image) where TDepth : struct { return(image.ConvertChannelDepth <Hsv <double>, Hsv <TDepth> >()); }