Classes | |
class | CRGBColorModel |
Training and application of an RGB color model on the basis of the Mahalanobis distance. More... | |
Functions | |
bool | ImageProcessor::CalculateHSVImage (const CByteImage *pInputImage, CByteImage *pOutputImage, const MyRegion *pROI=0) |
Computes the HSV image for a RGB CByteImage and writes the result to a CByteImage. More... | |
bool | ImageProcessor::FilterColor (const CByteImage *pInputImage, CByteImage *pOutputImage, ObjectColor cColor, CColorParameterSet *pColorParameterSet, bool bImageIsHSV=true) |
Performs color filtering with binarization for a CByteImage and writes the result to a grayscale CByteImage. More... | |
bool | ImageProcessor::FilterHSV (const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char hue, unsigned char tol_hue, unsigned char min_sat, unsigned char max_sat, unsigned char min_v, unsigned char max_v, const MyRegion *pROI=0) |
Performs color filtering with binarization for an HSV CByteImage and writes the result to a grayscale CByteImage. More... | |
bool | ImageProcessor::FilterHSV2 (const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char min_hue, unsigned char max_hue, unsigned char min_sat, unsigned char max_sat, unsigned char min_v, unsigned char max_v, const MyRegion *pROI=0) |
Performs color filtering with binarization for an HSV CByteImage and writes the result to a grayscale CByteImage. More... | |
bool | ImageProcessor::FilterRGB (const CByteImage *pInputImage, CByteImage *pOutputImage, CRGBColorModel *pColorModel, float fThreshold) |
Performs color filtering with binarization for an RGB CByteImage, given a CRGBColorModel, and writes the result to a grayscale CByteImage. More... | |
bool ImageProcessor::CalculateHSVImage | ( | const CByteImage * | pInputImage, |
CByteImage * | pOutputImage, | ||
const MyRegion * | pROI = 0 |
||
) |
Computes the HSV image for a RGB CByteImage and writes the result to a CByteImage.
Converts each pInputImage from RGB24 to HSV24 (Hue, Saturation, Value) and writes the result pOutputImage.
The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be both of type CByteImage::eRGB24.
The pixels of pOutputImage are after completion encoded according to the HSV color model, although the type of the image is CByteImage::eRGB24. The values S (Saturation) and V (Value) have a possible range of [0, 255]. The value H (Hue) has a possible range of [0, 179].
As this is a point operation, there is no copy overhead if pInputImage and pOutputImage share the same memory area.
pInputImage | The input image. |
pOutputImage | The output image. |
pROI | Describes the area containing the pixels which shall be converted. If pROI is 0, then the whole image is processed. |
Definition at line 4656 of file ImageProcessor.cpp.
bool ImageProcessor::FilterColor | ( | const CByteImage * | pInputImage, |
CByteImage * | pOutputImage, | ||
ObjectColor | cColor, | ||
CColorParameterSet * | pColorParameterSet, | ||
bool | bImageIsHSV = true |
||
) |
Performs color filtering with binarization for a CByteImage and writes the result to a grayscale CByteImage.
The color segmentation is performed using the FilterHSV method using the min/max values for the chosen color as defined in the ColorParameterSet.
The width and height of pInputImage and pOutputImage must match.
pInputImage | The input image. Must be of type CByteImage::eRGB24 and be eithter in RGB oder HSV format. |
pOutputImage | The output image. Must be of type CByteImage::eGrayScale. |
cColor | The color that will be segmented. |
pColorParameterSet | Contains color parameters, must contain the chosen color. |
bImageIsHSV | Indicates whether the image is already in HSV format. |
Definition at line 4218 of file ImageProcessor.cpp.
bool ImageProcessor::FilterHSV | ( | const CByteImage * | pInputImage, |
CByteImage * | pOutputImage, | ||
unsigned char | hue, | ||
unsigned char | tol_hue, | ||
unsigned char | min_sat, | ||
unsigned char | max_sat, | ||
unsigned char | min_v, | ||
unsigned char | max_v, | ||
const MyRegion * | pROI = 0 |
||
) |
Performs color filtering with binarization for an HSV CByteImage and writes the result to a grayscale CByteImage.
The color segmentation is performed using fixed bounds (with the operator <= and >=) for each color channel, except of hue where a center value and a +- tolerance are specified.
The width and height of pInputImage and pOutputImage must match.
pInputImage | The input image. Must be of type CByteImage::eRGB24 and is assumed to be an HSV image (see also CalculateHSVImage(const CByteImage*, CByteImage*, const *pROI)). |
pOutputImage | The output image. Must be of type CByteImage::eGrayScale. |
hue | The hue center. |
tol_hue | The hue tolerance. |
min_sat | The minimum saturation. |
max_sat | The maximum saturation. |
min_v | The minimum value. |
max_v | The maximum value. |
pROI | Describes the area containing the pixels which shall be processed. If pROI is 0, then the whole image is processed. |
Definition at line 4058 of file ImageProcessor.cpp.
bool ImageProcessor::FilterHSV2 | ( | const CByteImage * | pInputImage, |
CByteImage * | pOutputImage, | ||
unsigned char | min_hue, | ||
unsigned char | max_hue, | ||
unsigned char | min_sat, | ||
unsigned char | max_sat, | ||
unsigned char | min_v, | ||
unsigned char | max_v, | ||
const MyRegion * | pROI = 0 |
||
) |
Performs color filtering with binarization for an HSV CByteImage and writes the result to a grayscale CByteImage.
The color segmentation is performed using fixed bounds (with the operator <= and >=) for each color channel.
The width and height of pInputImage and pOutputImage must match.
pInputImage | The input image. Must be of type CByteImage::eRGB24 and is assumed to be a HSV image (see also CalculateHSVImage(const CByteImage*, CByteImage*, const *pROI)). |
pOutputImage | The output image. Must be of type CByteImage::eGrayScale. |
min_hue | The minimum hue. |
max_hue | The maximum hue. |
min_sat | The minimum saturation. |
max_sat | The maximum saturation. |
min_v | The minimum value. |
max_v | The maximum value. |
pROI | Describes the area containing the pixels which shall be processed. If pROI is 0, then the whole image is processed. |
Definition at line 4085 of file ImageProcessor.cpp.
bool ImageProcessor::FilterRGB | ( | const CByteImage * | pInputImage, |
CByteImage * | pOutputImage, | ||
CRGBColorModel * | pColorModel, | ||
float | fThreshold | ||
) |
Performs color filtering with binarization for an RGB CByteImage, given a CRGBColorModel, and writes the result to a grayscale CByteImage.
Calculates the color probability of each pixel in pInputImage based on the Mahalanobis distance and write the result to pOutputImage.
Using the covariance matrix C the Mahalanobis distance is calculated by . pOutputImage is a binary image.
The width and height of pInputImage and pOutputImage must match.
pInputImage | The input image. Must be of type CByteImage::eRGB24. |
pOutputImage | The output image. Must be of type CByteImage::eGrayScale. |
pColorModel | The color model. |
fThreshold | The threshold value. All color probabilities > fThreshold are set to 255, all other to 0. |
Definition at line 4035 of file ImageProcessor.cpp.