This interface provide functionalities of image conversion between different color spaces or formats. More...
Public Member Functions | |
void | BGRMix (ILImage *bgrImg, double w0, double w1, double w2, ILImage *grayImg) |
void | BGRToGray (ILImage *bgrImg, ILImage *grayImg) |
int | BGRToGrayColor (LColor bgrColor) |
void | ColorMap (ILImage *img, LPVColorMap cmap, ILImage *bgrImg, BOOL inv, BOOL normalize, double minValue, double maxValue) |
void | Convert (LPVColorSpace fromColorSpace, enum LPVColorSpace toColorSpace, ILImage *srcColorImg, ILImage *dstColorImg) |
struct LColor | ConvertColor (LPVColorSpace fromColorSpace, enum LPVColorSpace toColorSpace, LColor srcColor) |
void | Depth16To8 (ILImage *img16Bit, int fromNthBit, ILImage *img8Bit) |
void | Depth8To16 (ILImage *img8Bit, int fromNthBit, ILImage *img16Bit) |
void | GrayToBGR (ILImage *grayImg, ILImage *bgrImg) |
LColor | GrayToBGRColor (int grayColor) |
void | NormalizeTo8 (ILImage *img, double minValue, double maxValue, ILImage *img8Bit) |
Public Member Functions inherited from ILObject | |
ILObject * | Copy () |
LPVErrorCode | Load (LString filename) |
void | Reset () |
LPVErrorCode | Save (LString filename) |
BOOL | Valid () |
This interface provide functionalities of image conversion between different color spaces or formats.
To use this interface, you should create a LImageConvert object.
Mix the 3 channels in the input BGR color image using the specified weight for individual channel, as:
\[ Gray = w0⋅B + w1⋅G + w2⋅R \]
[in] | bgrImg | The input BGR color image |
[in] | w0 | The weight for the 1st(Blue) channel, in range -255 ~ 255 |
[in] | w1 | The weight for the 2nd(Green) channel, in range -255 ~ 255 |
[in] | w2 | The weight for the 3rd(Red) channel, in range -255 ~ 255 |
[out] | grayImg | Return the grayscale result image of the same size as the input. |
Convert a BGR color image to grayscale
\[ Gray = 0.114⋅B + 0.587⋅G + 0.299⋅R \]
[in] | bgrImg | The input BGR color image |
[out] | grayImg | Return the grayscale result image of the same size as the input. |
int BGRToGrayColor | ( | LColor | bgrColor | ) |
Convert a BGR color value to grayscale value
[in] | bgrColor | The input BGR color value |
grayColor | Return the grayscale value |
void ColorMap | ( | ILImage * | img, |
LPVColorMap | cmap, | ||
ILImage * | bgrImg, | ||
BOOL | inv, | ||
BOOL | normalize, | ||
double | minValue, | ||
double | maxValue | ||
) |
Apply color map on the given image, to generate a pseudo color image for data visualization
[in] | img | The input image |
[in] | cmap | The applied colormap, see LPVColorMap for details |
[out] | bgrImg | Return the result color image |
[in] | inv | Whether to invert the colormap. By default, it's false. |
[in] | normalize | Whether to normalize the input image based on the minValue ~ maxValue range, before applying colormap. By default, it's false. |
[in] | minValue | The specified minimum value of interest for normalization. Pass in negative to use the minimum of current image. |
[in] | maxValue | The specified maximum value of interest for normalization. Pass in negative to use the maximum of current image. |
void Convert | ( | LPVColorSpace | fromColorSpace, |
enum LPVColorSpace | toColorSpace, | ||
ILImage * | srcColorImg, | ||
ILImage * | dstColorImg | ||
) |
Convert the color image from one color space to another, for example, from BGR to HSV.
[in] | fromColorSpace | The current source color space |
[in] | toColorSpace | The destination color space |
[in] | srcColorImg | The input color image |
[out] | dstColorImg | Return the conversion result image |
struct LColor ConvertColor | ( | LPVColorSpace | fromColorSpace, |
enum LPVColorSpace | toColorSpace, | ||
LColor | srcColor | ||
) |
Convert the color value from one color space to another
[in] | fromColorSpace | The current source color space |
[in] | toColorSpace | The destination color space |
[in] | srcColor | The input color value |
dstColor | Return the conversion result |
Convert a 16bit image to 8bit depth, extracting the continues 8 bits from the specified index.
[in] | img16Bit | The input 16bit image | ||||||||
[in] | fromNthBit | The starting index, in range -7 ~ 15 to ensure at least 1 valid bit
| ||||||||
[out] | img8Bit | Return the result 8bit image |
Convert a 8bit image to 16bit depth, set the continues 8 bits from the specified index.
[in] | img8Bit | The input 8bit image | ||||||||
[in] | fromNthBit | The starting index, in range -7 ~ 15 to ensure at least 1 valid bit
| ||||||||
[out] | img16Bit | Return the result 16bit image |
Convert a grayscale image to a BGR color image, all three channels are assigned to the same value.
\[ B = Gray, G = Gray, R = Gray \]
[in] | grayImg | The input grayscale image |
[out] | bgrImg | Return the BGR color image of the same size as the input |
LColor GrayToBGRColor | ( | int | grayColor | ) |
Convert a grayscale value to a BGR color value, all three channels are assigned to the same value.
[in] | grayColor | The input grayscale value |
bgrColor | Return the BGR color value |
Normalize the given image (of any depth) to 8bit depth, stretching the values between the given minimum and maximum value.
[in] | img | The input image |
[in] | minValue | The specified minimum value of interest. Pass in negative to use the minimum of current image. |
[in] | maxValue | The specified maximum value of interest. Pass in negative to use the maximum of current image. |
[out] | img8Bit | Return the result 8bit image |