112 for (
int i = 0; i < nSize; i++)
128 printf(
"error: call CObjectColorSegmenter::SetImage first and do not use optimizer\n");
145 printf(
"error: color parameter set has not been set\n");
151 printf(
"error: call CObjectColorSegmenter::SetImage first\n");
159 printf(
"error: could not load parameters for segmenting color\n");
168 for (
int i = 0; i < nSize; i++)
172 if (entry.
color == color)
190 for (
int i = 0; i < nSize; i++)
194 if (entry.
color == color)
214 printf(
"error: call CObjectColorSegmenter::SetImage first\n");
223 for (
int i = 0; i < nSize; i++)
227 if (entry.
color == color)
const int * GetColorParameters(ObjectColor color) const
bool IsCompatible(const CByteImage *pImage) const
Checks whether two images are compatible or not.
bool FindRegions(const CByteImage *pImage, RegionList ®ionList, int nMinimumPointsPerRegion=0, int nMaximumPointsPerRegion=0, bool bCalculateBoundingBox=true, bool bStorePixels=false)
Performs region growing on a binary CByteImage, segmenting all regions in the image.
bool CalculateSaturationImage(const CByteImage *pInputImage, CByteImage *pOutputImage)
Calculates the saturation image for an RGB CByteImage and writes the result to a CByteImage.
bool Dilate(const CByteImage *pInputImage, CByteImage *pOutputImage, int nMaskSize=3, const MyRegion *pROI=0)
Applies a morphological dilate operation to a binary CByteImage and writes the result to a binary CBy...
int width
The width of the image in pixels.
void SetColorParameterSet(const CColorParameterSet *pColorParameterSet)
void FindRegionsOfGivenColor(CByteImage *pResultImage, ObjectColor color, RegionList ®ionList, int nMinPointsPerRegion)
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
bool 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.
CByteImage * m_pTempImage
std::vector< MyRegion > RegionList
void SetImage(const CByteImage *pImage, const Object2DList *pROIList=0)
std::vector< Object2DEntry > Object2DList
void CalculateSegmentedImage(CByteImage *pResultImage, ObjectColor color)
int height
The height of the image in pixels.
bool ThresholdBinarize(const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nThreshold)
Performs threshold binarization to a CByteImage and writes the result to a CByteImage.
const Object2DList * m_pROIList
const CColorParameterSet * m_pColorParameterSet
bool Erode(const CByteImage *pInputImage, CByteImage *pOutputImage, int nMaskSize=3, const MyRegion *pROI=0)
Applies a morphological erode operation to a binary CByteImage and writes the result to a binary CByt...
void FindColoredRegions(CByteImage *pResultImage, RegionList ®ionList, int nMinPointsPerRegion)
const CByteImage * m_pRGBImage
void Zero(CByteImage *pImage, const MyRegion *pROI=0)
Sets all values in a CByteImage to zero.
bool 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...