Enumerations | Functions
ImageProcessor Namespace Reference

Central namespace offering various image processing routines and functions. More...

Enumerations

enum  BayerPatternType { eBayerRG, eBayerGR, eBayerBG, eBayerGB }
 The four possible variants for Bayer pattern conversion. More...

Functions

bool AbsoluteDifference (const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
 Sets each pixel in a CByteImage to the absolute value of the difference between the corresponding pixels in two instances of CByteImage.
bool AdaptFrame (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Sets all pixels on a one pixel wide outer frame in a CByteImage to the pixel values of the inner frame of a CByteImage.
bool Add (const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
 Sets each pixel in a CByteImage to the sum of the corresponding pixels in two instances of CByteImage.
bool AddWithSaturation (const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
 Sets each pixel in a CByteImage to the sum of the corresponding pixels in two instances of CByteImage, handling overflows with saturation.
bool Amplify (const CByteImage *pInputImage, CByteImage *pOutputImage, float fFactor)
 Multiplies each byte value of a CByteImage with a floating point factor and writes the result to a CByteImage.
bool And (const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
 Applies the bitwise operator AND to two instance of CByteImage and writes the result to a CByteImage.
bool ApplyAffinePointOperation (const CByteImage *pInputImage, CByteImage *pOutputImage, float a, float b)
 Applies an affine point operation to a CByteImage and writes the result to a CByteImage.
bool ApplyHomography (const CByteImage *pInputImage, CByteImage *pOutputImage, const Mat3d &A, bool bInterpolation=true)
 Applies a homography to a CByteImage and writes the result to a CByteImage.
bool ApplyHomography (const CByteImage *pInputImage, CByteImage *pOutputImage, float a1, float a2, float a3, float a4, float a5, float a6, float a7, float a8, bool bInterpolation=true)
 Deprecated.
bool Average (const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
 Sets each pixel in a CByteImage to the average of the corresponding pixels in two instances of CByteImage.
bool AverageFilter (const CByteImage *pInputImage, CByteImage *pOutputImage, int nMaskSize=3)
 Applies an average filter to a CByteImage and writes the result to a CByteImage.
bool CalculateBinarizedSummedAreaTable (const CByteImage *pInputImage, CIntImage *pSummedAreaTable)
 Calculates the binarized summed area table of a grayscale CByteImage and writes the result to a CIntImage.
bool CalculateGradientImage (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Applies a combined simple gradient filter for both x- and y-direction to a CByteImage and stores the result in a CByteImage.
bool CalculateGradientImageBinary (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Calculates a gradient image for a CByteImage and writes the result to a CByteImage, for the special case of binary images.
bool CalculateGradientImagePrewitt (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Applies a combined Prewitt filter for both x- and y-direction to a CByteImage and stores the result in a CByteImage.
bool CalculateGradientImageSobel (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Applies a combined Sobel filter for both x- and y-direction to a CByteImage and stores the result in a CByteImage.
int CalculateHarrisInterestPoints (const CByteImage *pInputImage, Vec2d *pInterestPoints, int nMaxPoints, float fQualityLevel=0.01f, float fMinDistance=5.0f)
 Computes interest points within a CByteImage by applying the Harris corner detector.
bool CalculateHarrisMap (const CByteImage *pInputImage, CIntImage *pOutputImage)
 Calculates the Harris cornerness measure for every pixel in a CByteImage and writes the results to a CIntImage.
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.
bool CalculateIntegralImage (const CByteImage *pInputImage, CIntImage *pIntegralImage)
 Calculates the integral image of a grayscale CByteImage and writes the result to a CIntImage.
bool CalculateReverseSummedAreaTable (const CIntImage *pSummedAreaTable, CByteImage *pOutputImage)
 Reconstructs the original image, given a summed area table, and writes the result to a grayscale CByteImage.
bool CalculateSaturationImage (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Calculates the saturation image for an RGB CByteImage and writes the result to a CByteImage.
bool CalculateSummedAreaTable (const CByteImage *pInputImage, CIntImage *pSummedAreaTable)
 Calculates the summed area table of a grayscale CByteImage and writes the result to a CIntImage.
bool Canny (const CByteImage *pInputImage, CByteImage *pOutputImage, int nLowThreshold, int nHighThreshold)
 Applies the Canny edge detector to a CByteImage and writes the result to a CByteImage.
bool Canny (const CByteImage *pInputImage, CVec2dArray &resultPoints, CVec2dArray &resultDirections, int nLowThreshold, int nHighThreshold)
 Applies the Canny edge detector to a CByteImage and writes the edge pixels and directions to two instances of CVec2dArray.
bool ConvertBayerPattern (const CByteImage *pInputImage, CByteImage *pOutputImage, BayerPatternType type)
 Converts an 8 bit Bayer pattern CByteImage to an RGB24 color CByteImage.
bool ConvertImage (const CByteImage *pInputImage, CByteImage *pOutputImage, bool bFast=false, const MyRegion *pROI=0)
 Converts a grayscale CByteImage to an RGB CByteImage image and vice versa.
bool ConvertImage (const CFloatImage *pInputImage, CByteImage *pOutputImage, bool equalize=false)
 Converts a CFloatImage to a CByteImage.
bool ConvertImage (const CByteImage *pInputImage, CFloatImage *pOutputImage)
 Converts a CByteImage to a CFloatImage.
bool ConvertImage (const CFloatMatrix *pInputImage, CByteImage *pOutputImage)
 Converts a CFloatMatrix to a grayscale CByteImage.
bool ConvertImage (const CByteImage *pInputImage, CFloatMatrix *pOutputImage)
 Converts a grayscale CByteImage to a CFloatMatrix.
bool ConvertImage (const CShortImage *pInputImage, CByteImage *pOutputImage)
 Converts a CShortImage to a grayscale CByteImage.
bool ConvertImage (const CByteImage *pInputImage, CShortImage *pOutputImage)
 Converts a grayscale CByteImage to a CShortImage.
bool ConvertImage (const CIntImage *pInputImage, CByteImage *pOutputImage)
 Converts a CIntImage to a grayscale CByteImage.
bool ConvertImage (const CByteImage *pInputImage, CIntImage *pOutputImage)
 Converts a grayscale CByteImage to a CIntImage.
bool ConvertMatrix (const CFloatMatrix *pInputImage, CDoubleMatrix *pOutputImage)
 Converts a CFloatMatrix to a CDoubleMatrix.
bool ConvertMatrix (const CDoubleMatrix *pInputImage, CFloatMatrix *pOutputImage)
 Converts a CDoubleMatrix to a CFloatMatrix.
bool CopyFrame (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Copies all pixels on a one pixel wide frame from one CByteImage to CByteImage.
bool CopyImage (const CByteImage *pInputImage, CByteImage *pOutputImage, const MyRegion *pROI=0, bool bUseSameSize=false)
 Copies one CByteImage to another.
bool CopyImage (const CShortImage *pInputImage, CShortImage *pOutputImage, const MyRegion *pROI=0, bool bUseSameSize=false)
 Copies one CShortImage to another.
bool CopyMatrix (const CFloatMatrix *pInputImage, CFloatMatrix *pOutputImage)
 Copies one CFloatMatrix to another.
bool CopyMatrix (const CDoubleMatrix *pInputImage, CDoubleMatrix *pOutputImage)
 Copies one CDoubleMatrix to another.
bool DetermineAffineTransformation (const Vec2d *pSourcePoints, const Vec2d *pTargetPoints, int nPoints, float &a1, float &a2, float &a3, float &a4, float &a5, float &a6)
 Deprecated.
bool DetermineHomography (const Vec2d *pSourcePoints, const Vec2d *pTargetPoints, int nPoints, float &a1, float &a2, float &a3, float &a4, float &a5, float &a6, float &a7, float &a8)
 Deprecated.
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 CByteImage.
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 CByteImage.
bool 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.
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 CByteImage.
bool 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.
bool 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.
bool FindRegions (const CByteImage *pImage, RegionList &regionList, 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 FindRegions (const CByteImage *pImage, CRegionArray &regionList, 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 FlipY (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Flips the rows in a CByteImage vertically and writes the result to a CByteImage.
bool GaussianSmooth (const CByteImage *pInputImage, CFloatMatrix *pOutputImage, float fVariance, int nKernelSize)
 Applies a Gaussian filter to a CByteImage and writes the result to a CFloatMatrix.
bool GaussianSmooth (const CFloatMatrix *pInputImage, CFloatMatrix *pOutputImage, float fVariance, int nKernelSize)
 Applies a Gaussian filter to a CFloatMatrix and writes the result to a CFloatMatrix.
bool GaussianSmooth (const CByteImage *pInputImage, CByteImage *pOutputImage, float fVariance, int nKernelSize)
 Applies a Gaussian filter to a CByteImage and writes the result to a CByteImage.
bool GaussianSmooth3x3 (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Applies a 3x3 Gaussian filter to a CByteImage and writes the result to a CByteImage.
bool GaussianSmooth5x5 (const CFloatMatrix *pInputImage, CFloatMatrix *pOutputImage, float fVariance)
 Applies a 5x5 Gaussian filter to a CFloatMatrix and writes the result to a CFloatMatrix.
bool GaussianSmooth5x5 (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Applies a 5x5 Gaussian filter to a CByteImage and writes the result to a CByteImage.
bool GeneralFilter (const CByteImage *pInputImage, CByteImage *pOutputImage, const int *pKernel, int nMaskSize, int nDivider=1, bool bAbsoluteValue=false)
 Applies a user defined filter to a CByteImage and writes the result to a CByteImage.
bool GeneralFilter (const CByteImage *pInputImage, CShortImage *pOutputImage, const int *pKernel, int nMaskSize, int nDivider=1, bool bAbsoluteValue=false)
 Applies a user defined filter to a CByteImage and writes the result to a CShortImage.
bool GeneralFilter (const CByteImage *pInputImage, CFloatMatrix *pOutputImage, const int *pKernel, int nMaskSize, int nDivider=1, bool bAbsoluteValue=false)
 Applies a user defined filter to a CByteImage and writes the result to a CFloatMatrix.
int GetAreaSum (const CIntImage *pIntegralImage, int min_x, int min_y, int max_x, int max_y)
 Efficiently computes the sum of all pixel values in a rectangular area using integral image lookups.
int GetAreaSum (const CIntImage *pIntegralImage, const MyRegion *pRegion)
 Efficiently computes the sum of all pixel values in a rectangular area using integral image lookups.
int GetAreaSumNoChecks (const CIntImage *pIntegralImage, int min_x, int min_y, int max_x, int max_y)
 Efficiently computes the sum of all pixel values in a rectangular area using integral image lookups.
bool HighPassX3 (const CFloatMatrix *pInputImage, CFloatMatrix *pOutputImage)
 Applies a 1x3 highpass filter to a CFloatMatrix and write the result to a CFloatMatrix.
bool HighPassY3 (const CFloatMatrix *pInputImage, CFloatMatrix *pOutputImage)
 Applies a 3x1 highpass filter to a CFloatMatrix and writes the result to a CFloatMatrix.
bool HistogramEqualization (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Performs histogram equalization for a CByteImage and writes the result to a CByteImage.
bool HistogramStretching (const CByteImage *pInputImage, CByteImage *pOutputImage, float p1=0.1f, float p2=0.9f)
 Performs histogram stretching on pInputImage and stores the result in pOutputImage.
bool HoughTransformCircles (const CByteImage *pImage, CByteImage *pVisualizationImage, Vec3dList &resultCircles, int rmin, int rmax, int nCirclesToExtract, int nMinHits=1)
 Performs the Hough transform for circles on a CByteImage.
bool HoughTransformCircles (const CVec2dArray &edgePoints, const CVec2dArray &edgeDirections, int width, int height, int rmin, int rmax, int nCirclesToExtract, int nMinHits, CVec3dArray &resultCircles, CIntArray &resultHits, CByteImage *pVisualizationImage=0)
 Performs the Hough transform for circles, given a list of edge points and directions.
bool HoughTransformLines (const CByteImage *pImage, CByteImage *pVisualizationImage, Vec2dList &resultLines, int nLinesToExtract, int nMinHits=1)
 Performs the Hough transform for straight lines on a CByteImage.
void HoughTransformLines (const CVec2dArray &edgePoints, const CVec2dArray &edgeDirections, int width, int height, int nLinesToExtract, int nMinHits, CVec2dArray &resultLines, CIntArray &resultHits, CByteImage *pVisualizationImage=0)
 Performs the Hough transform for straight lines, given a list of edge points and directions.
bool Invert (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Calculates the inverted image of a CByteImage and writes the result to a CByteImage.
bool Laplace1 (const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue=true)
 Filters a CByteImage with the Laplace1 operator and writes the result to a CShortImage.
bool Laplace1 (const CByteImage *pInputImage, CByteImage *pOutputImage, bool bAbsoluteValue=true)
 Filters a CByteImage with the Laplace1 operator and writes the result to a CByteImage.
bool Laplace2 (const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue=true)
 Filters a CByteImage with the Laplace2 operator and writes the result to a CShortImage.
bool Laplace2 (const CByteImage *pInputImage, CByteImage *pOutputImage, bool bAbsoluteValue=true)
 Filters a CByteImage with the Laplace2 operator and writes the result to a CByteImage.
bool Max (const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
 Sets each pixel in a CByteImage to the maximum of the corresponding pixels in two instances of CByteImage.
unsigned char MaxValue (const CByteImage *pImage)
 Returns the maximum value within a grayscale CByteImage.
short MaxValue (const CShortImage *pImage)
 Returns the maximum value within a CShortImage.
int MaxValue (const CIntImage *pImage)
 Returns the maximum value within a CIntImage.
bool Min (const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
 Sets each pixel in a CByteImage to the minimum of the corresponding pixels in two instances of CByteImage.
bool MinMaxValue (const CByteImage *pImage, unsigned char &min, unsigned char &max)
 Computes the minimum and maximum value within a grayscale CByteImage.
void MinMaxValue (const CShortImage *pImage, short &min, short &max)
 Computes the minimum and maximum value within a CShortImage.
void MinMaxValue (const CIntImage *pImage, int &min, int &max)
 Computes the minimum and maximum value within a CIntImage.
unsigned char MinValue (const CByteImage *pImage)
 Returns the minimum value within a grayscale CByteImage.
short MinValue (const CShortImage *pImage)
 Returns the minimum value within a CShortImage.
int MinValue (const CIntImage *pImage)
 Returns the minimum value within a CIntImage.
bool NormalizeColor (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Applies histogram equalization to all channels of a color CByteImage.
bool Or (const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
 Applies the bitwise operator OR to two instance of CByteImage and writes the result to a CByteImage.
unsigned int PixelSum (const CByteImage *pImage)
 Returns the sum of all pixel values of a grayscale CByteImage.
bool PrewittX (const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue=true)
 Filters a CByteImage with the PrewittX operator and writes the result to a CShortImage.
bool PrewittX (const CByteImage *pInputImage, CByteImage *pOutputImage, bool bAbsoluteValue=true)
 Filters a CByteImage with the PrewittX operator and writes the result to a CByteImage.
bool PrewittY (const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue=true)
 Filters a CByteImage with the PrewittY operator and writes the result to a CShortImage.
bool PrewittY (const CByteImage *pInputImage, CByteImage *pOutputImage, bool bAbsoluteValue=true)
 Filters a CByteImage with the PrewittY operator and writes the result to a CByteImage.
int RegionGrowing (const CByteImage *pInputImage, MyRegion &resultRegion, int x, int y, int nMinimumPointsPerRegion=0, int nMaximumPointsPerRegion=0, bool bCalculateBoundingBox=true, bool bStorePixels=false)
 Performs a region growing on a binary CByteImage on the basis of one seed point and stores the computed region in a MyRegion.
bool Resize (const CByteImage *pInputImage, CByteImage *pOutputImage, const MyRegion *pROI=0, bool bInterpolation=true)
 Resizes a CByteImage and writes the result to a CByteImage.
bool Rotate (const CByteImage *pInputImage, CByteImage *pOutputImage, float mx, float my, float theta, bool bInterpolation=true)
 Rotates pInputImage to the dimensions specified by pOutputImage and stores the result in pOutputImage.
bool Rotate180Degrees (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Rotates a CByteImage by 180 degrees and writes the result to a CByteImage.
bool SobelX (const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue=true)
 Filters a CByteImage with the SobelX operator and writes the result to a CShortImage.
bool SobelX (const CByteImage *pInputImage, CByteImage *pOutputImage, bool bAbsoluteValue=true)
 Filters a CByteImage with the SobelX operator and writes the result to a CByteImage.
bool SobelY (const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue=true)
 Filters a CByteImage with the SobelY operator and writes the result to a CShortImage.
bool SobelY (const CByteImage *pInputImage, CByteImage *pOutputImage, bool bAbsoluteValue=true)
 Filters a CByteImage with the SobelY operator and writes the result to a CByteImage.
bool Spread (const CByteImage *pInputImage, CByteImage *pOutputImage)
 Performs a spread operation on pInputImage and stores the result in pOutputImage.
bool Subtract (const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
 Sets each pixel in a CByteImage to the difference between the corresponding pixels in two instances of CByteImage.
bool SubtractWithSaturation (const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
 Sets each pixel in a CByteImage to the difference between the corresponding pixels in two instances of CByteImage, handling overflows with saturation.
bool ThresholdBinarize (const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nThreshold)
 Performs threshold binarization to a CByteImage and writes the result to a CByteImage.
bool ThresholdBinarize (const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nMinThreshold, unsigned char nMaxThreshold)
 Performs threshold binarization to a CByteImage and writes the result to a CByteImage.
bool ThresholdBinarize (const CFloatMatrix *pInputImage, CFloatMatrix *pOutputImage, float fThreshold)
 Performs threshold binarization to a CFloatMatrix and writes the result to a CFloatMatrix.
bool ThresholdBinarizeInverse (const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nThreshold)
 Performs inverse threshold binarization to a CByteImage and writes the result to a CByteImage.
bool ThresholdFilter (const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nThreshold)
 Performs threhold filtering to a CByteImage and writes the result to a CByteImage.
bool ThresholdFilterInverse (const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nThreshold)
 Performs inverse threhold filtering to a CByteImage and writes the result to a CByteImage.
bool Xor (const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
 Applies the bitwise operator XOR to two instance of CByteImage and writes the result to a CByteImage.
void Zero (CByteImage *pImage, const MyRegion *pROI=0)
 Sets all values in a CByteImage to zero.
void Zero (CShortImage *pImage)
 Sets all values in a CShortImage to zero.
void Zero (CIntImage *pImage)
 Sets all values in a CIntImage to zero.
void Zero (CFloatMatrix *pImage)
 Sets all values in a CFloatMatrix to zero.
void Zero (CDoubleMatrix *pImage)
 Sets all values in a CDoubleMatrix to zero.
void ZeroFrame (CByteImage *pImage)
 Sets all pixels on a one pixel wide frame of a CByteImage to zero.
void ZeroFrame (CShortImage *pImage)
 Sets all pixels on a one pixel wide frame of a CShortImage to zero.
void ZeroFrame (CIntImage *pImage)
 Sets all pixels on a one pixel wide frame of a CIntImage to zero.

Detailed Description

Central namespace offering various image processing routines and functions.

The ImageProcessor namespace provides various image processing functions, mostly operating on instances of CByteImage, but also CShortImage and CIntImage, and conversion functions between these types. Among the offered functions are filtering (edge filters, smoothing filters), color segmentation, edge detection, corner detection, line/circle detection, histogram-based operators, morphological operators, arithmetic operators, logical operators, affine point operators, homography transformations, resize, thresholding and region growing.


Enumeration Type Documentation

The four possible variants for Bayer pattern conversion.

This enum is used for specifying the variant of Bayer pattern to be processed in ConvertBayerPattern(const CByteImage*, CByteImage*, BayerPatternType). In eBayerXY, XY describes the type of the first two pixels of the Bayer pattern in the top left corner of the image.

The simplest approach is to find out which is the correct one for a specific camera is to simply try all four parameters and check in the computed RGB color image, if the colors are correct (in particular red and blue).

Enumerator:
eBayerRG 
eBayerGR 
eBayerBG 
eBayerGB 

Definition at line 1756 of file ImageProcessor.h.


Function Documentation

bool ImageProcessor::AbsoluteDifference ( const CByteImage pInputImage1,
const CByteImage pInputImage2,
CByteImage pOutputImage 
)

Sets each pixel in a CByteImage to the absolute value of the difference between the corresponding pixels in two instances of CByteImage.

This function implements the following point operation: pOutputImage->pixels[i] = abs((int) pInputImage1->pixels[i] - (int) pInputImage2->pixels[i]).

Overflows cannot occur.

The width, height and type of pInputImage1, pInputImage2 and pOutputImage must match.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

As this is a point operation, there is no copy overhead if pInputImage1, pInputImage2, or pOutputImage share the same memory area.

Parameters:
pInputImage1The first input image.
pInputImage2The second input image.
pOutputImageThe output image.

Definition at line 7173 of file ImageProcessor.cpp.

bool ImageProcessor::AdaptFrame ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Sets all pixels on a one pixel wide outer frame in a CByteImage to the pixel values of the inner frame of a CByteImage.

This function is useful for post-processing of filter responses, in particular low pass filters (smoothing filters), which do not compute values for the outer frame. For high pass filters (edge filters) it is also meaningful to call Zero(CByteImage*).

The outer frame consists of the top and bottom row as well as the leftmost and rightmost column. The inner frame consists of the second top most and second bottom most rows as well as the second leftmost and second rightmost columns.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be either both of type CByteImage::eGrayScale or both of type CByteImage::eRGB24.

pInputImage and pOutputImage can be pointers to the same image, with no runtime penalty.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 3144 of file ImageProcessor.cpp.

bool ImageProcessor::Add ( const CByteImage pInputImage1,
const CByteImage pInputImage2,
CByteImage pOutputImage 
)

Sets each pixel in a CByteImage to the sum of the corresponding pixels in two instances of CByteImage.

This function implements the following point operation: pOutputImage->pixels[i] = pInputImage1->pixels[i] + pInputImage2->pixels[i].

No saturation is performed, i.e. overflows are not handled. For instance, 200 + 56 results in 0, 200 + 57 results in 1, and so on.

The width, height and type of pInputImage1, pInputImage2 and pOutputImage must match.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

As this is a point operation, there is no copy overhead if pInputImage1, pInputImage2, or pOutputImage share the same memory area.

Parameters:
pInputImage1The first input image.
pInputImage2The second input image.
pOutputImageThe output image.

Definition at line 7077 of file ImageProcessor.cpp.

bool ImageProcessor::AddWithSaturation ( const CByteImage pInputImage1,
const CByteImage pInputImage2,
CByteImage pOutputImage 
)

Sets each pixel in a CByteImage to the sum of the corresponding pixels in two instances of CByteImage, handling overflows with saturation.

This function implements the following point operation: pOutputImage->pixels[i] = MY_MAX((unsigned int) pInputImage1->pixels[i] + (unsigned int) pInputImage2->pixels[i], 255).

Saturation is performed, i.e. overflows are handled with truncation. For instance, 200 + 56 results in 255, 200 + 57 results in 255, and so on.

The width, height and type of pInputImage1, pInputImage2 and pOutputImage must match.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

As this is a point operation, there is no copy overhead if pInputImage1, pInputImage2, or pOutputImage share the same memory area.

Parameters:
pInputImage1The first input image.
pInputImage2The second input image.
pOutputImageThe output image.

Definition at line 7101 of file ImageProcessor.cpp.

bool ImageProcessor::Amplify ( const CByteImage pInputImage,
CByteImage pOutputImage,
float  fFactor 
)

Multiplies each byte value of a CByteImage with a floating point factor and writes the result to a CByteImage.

Overflows are handled by truncation.

The width, height and type of pInputImage and pOutputImage must match. All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
fFactorThe amplification factor.

Definition at line 3827 of file ImageProcessor.cpp.

bool ImageProcessor::And ( const CByteImage pInputImage1,
const CByteImage pInputImage2,
CByteImage pOutputImage 
)

Applies the bitwise operator AND to two instance of CByteImage and writes the result to a CByteImage.

This function implements the following point operation: pOutputImage->pixels[i] = pInputImage1->pixels[i] & pInputImage2->pixels[i].

The width, height and type of pInputImage1, pInputImage2 and pOutputImage must match.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

As this is a point operation, there is no copy overhead if pInputImage1, pInputImage2, or pOutputImage share the same memory area.

Parameters:
pInputImage1The first input image.
pInputImage2The second input image.
pOutputImageThe output image.

Definition at line 7007 of file ImageProcessor.cpp.

bool ImageProcessor::ApplyAffinePointOperation ( const CByteImage pInputImage,
CByteImage pOutputImage,
float  a,
float  b 
)

Applies an affine point operation to a CByteImage and writes the result to a CByteImage.

Applies an affine point operation with the formula a * x + b to pInputImage and writes the result to pOutputImage.
The resulting float value is rounded to an integer value v, and min(255, max(0, v)) is written to pOutputImage.

The width, height and type of pInputImage and pOutputImage must match.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
aCoefficient for the affine point operation (factor).
bCoefficient for the affine point operation (addend).

Definition at line 1993 of file ImageProcessor.cpp.

bool ImageProcessor::ApplyHomography ( const CByteImage pInputImage,
CByteImage pOutputImage,
const Mat3d A,
bool  bInterpolation = true 
)

Applies a homography to a CByteImage and writes the result to a CByteImage.

The homography can generally be formulated using homogenous coordinates as follows: $ \left( \begin{array}{c} u' s \\ v' s \\ s \end{array} \right) = \left( \begin{array}{ccc} a_1 & a_2 & a_3 \\ a_4 & a_5 & a_6 \\ a_7 & a_8 & a_9 \end{array} \right) \cdot \left( \begin{array}{c} u \\ v \\ 1 \end{array} \right) $. $ a_9 = 1 $ is assumed without loss of generality because all real-valued multiples of the matrix define the same mapping. The mapping takes place as follows: for every (u, v) in the new image pOutputImage, the homography specified by the parameters $a_1, \ldots, a_8$ computes in the original image pInputImage.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be either both of type CByteImage::eGrayScale or both of type CByteImage::eRGB24.

If pInputImage and pOutputImage share the same memory area, the input image is copied to a temporary image first.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
AThe 3x3 describing the homography matrix.
bInterpolationDetermines whether bilinear interpolation is used or not.

Definition at line 3223 of file ImageProcessor.cpp.

bool ImageProcessor::ApplyHomography ( const CByteImage pInputImage,
CByteImage pOutputImage,
float  a1,
float  a2,
float  a3,
float  a4,
float  a5,
float  a6,
float  a7,
float  a8,
bool  bInterpolation = true 
)

Deprecated.

Deprecated:

This function is deprecated. It internally calls ApplyHomography(const CByteImage*, CByteImage*, const Mat3d&, bool) (A.r9 is set to 1.0f); please refer to the documentation of this function for more information.

Definition at line 3217 of file ImageProcessor.cpp.

bool ImageProcessor::Average ( const CByteImage pInputImage1,
const CByteImage pInputImage2,
CByteImage pOutputImage 
)

Sets each pixel in a CByteImage to the average of the corresponding pixels in two instances of CByteImage.

This function implements the following point operation: pOutputImage->pixels[i] = (pInputImage1->pixels[i] + pInputImage2->pixels[i] + 1) >> 1.

Overflows cannot occur.

The width, height and type of pInputImage1, pInputImage2 and pOutputImage must match.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

As this is a point operation, there is no copy overhead if pInputImage1, pInputImage2, or pOutputImage share the same memory area.

Parameters:
pInputImage1The first input image.
pInputImage2The second input image.
pOutputImageThe output image.

Definition at line 7197 of file ImageProcessor.cpp.

bool ImageProcessor::AverageFilter ( const CByteImage pInputImage,
CByteImage pOutputImage,
int  nMaskSize = 3 
)

Applies an average filter to a CByteImage and writes the result to a CByteImage.

Applies an average filter (low pass filter) of size nMaskSize x nMaskSize to pInputImage and writes the result to pOutputImage.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be of type CByteImage::eGrayScale.

If pInputImage and pOutputImage share the same memory area, the input image is copied to a temporary image first.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
nMaskSizeDetermines the side length of the window whose interior points are used for computing the average. Must be an odd integer greater than 2.

Definition at line 690 of file ImageProcessor.cpp.

bool ImageProcessor::CalculateBinarizedSummedAreaTable ( const CByteImage pInputImage,
CIntImage pSummedAreaTable 
)

Calculates the binarized summed area table of a grayscale CByteImage and writes the result to a CIntImage.

In the binarized summed area table, each value is the count of all non-zero values in pInputImage left and above of it, i.e. $ {\rm BinarizedSummedAreaTable}_{x, y} = \sum_{i=0}^x \sum_{j=0}^y min(1, I_{i, j}) $.

This function is useful if the image size is so large that overflows can occur when applying CalculateIntegralImage(const CByteImage*, CIntImage*) (resp. CalculateSummedAreaTable(const CByteImage*, CIntImage*)). For example, the maximum value for a 1024x768 image is 1024 * 768 * 255 = 200540160 < 2147483647 = INT_MAX, which is ok. Overflows will occur approximately for images with more than 8 megapixels.

Parameters:
pInputImageThe input image. Must be of type CByteImage::eGrayScale.
pSummedAreaTableThe output image.

Definition at line 6286 of file ImageProcessor.cpp.

bool ImageProcessor::CalculateGradientImage ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Applies a combined simple gradient filter for both x- and y-direction to a CByteImage and stores the result in a CByteImage.

Applies a 1x3 gradient operator of the form (-1 0 1) and a 3x1 gradient operator of the form (1 0 -1)^T for each pixel of pInputImage, resulting in the values gx and gy, and writes the result min(255, max(gx, gy)) to pOutputImage. In the case of color images, each channel is processed independently.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be either both of type CByteImage::eGrayScale or both of type CByteImage::eRGB24. In the case of CByteImage::eRGB24, each channel is processed independently and for each pixel, the maximum over all channels is taken.

If pInputImage and pOutputImage share the same memory area, the input image is copied to a temporary image first.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 1315 of file ImageProcessor.cpp.

bool ImageProcessor::CalculateGradientImageBinary ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Calculates a gradient image for a CByteImage and writes the result to a CByteImage, for the special case of binary images.

Calculates a gradient image for a binary image stored in pInputImage and writes the result to pOutputImage. This function implements an optimized version of $ I_g(x,y) = \max(|I(x+1,y) - I(x,y)|, |I(x,y+1)-I(x,y)|)$ for the special case of binary images.

Note that the gradient locations are in general displaced with an offset of (-0.5, -0.5) pixels with respect to the true edge locations in the input image. If subpixel accuracy is needed, it is recommended to filter the image with a Gaussian filter first (e.g. GaussianSmooth5x5(const CByteImage*, CByteImage*)) and then apply a general edge filter (e.g. CalculateGradientImageSobel(const CByteImage*, CShortImage*)) or an edge detector (e.g. Canny(const CByteImage*, CVec2dArray&, CVec2dArray&, int, int), which directly outputs edge points with subpixel accuracy). The width and height of pInputImage and pOutputImage must match.

pInputImage and pOutputImage must be both of type CByteImage::eGrayScale and must contain binary images, i.e. contain only two different values: 0 and a non-zero value (usually 255 for visualization purposes).

If pInputImage and pOutputImage share the same memory area, the input image is copied to a temporary image first.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 1385 of file ImageProcessor.cpp.

bool ImageProcessor::CalculateGradientImagePrewitt ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Applies a combined Prewitt filter for both x- and y-direction to a CByteImage and stores the result in a CByteImage.

Applies a PrewittX and a PrewittY operator for each pixel of pInputImage, resulting in the values gx and gy, and writes the result min(255, max(gx, gy)) to pOutputImage.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be of type CByteImage::eGrayScale.

If pInputImage and pOutputImage share the same memory area, the input image is copied to a temporary image first.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 1207 of file ImageProcessor.cpp.

bool ImageProcessor::CalculateGradientImageSobel ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Applies a combined Sobel filter for both x- and y-direction to a CByteImage and stores the result in a CByteImage.

Applies a SobelX and a SobelY operator for each pixel of pInputImage, resulting in the values gx and gy, and writes the result min(255, max(gx, gy)) to pOutputImage.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be of type CByteImage::eGrayScale.

If pInputImage and pOutputImage share the same memory area, the input image is copied to a temporary image first.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 1261 of file ImageProcessor.cpp.

int ImageProcessor::CalculateHarrisInterestPoints ( const CByteImage pInputImage,
Vec2d pInterestPoints,
int  nMaxPoints,
float  fQualityLevel = 0.01f,
float  fMinDistance = 5.0f 
)

Computes interest points within a CByteImage by applying the Harris corner detector.

Uses the function CalculateHarrisMap(const CByteImage*, CIntImage*) to compute a cornerness map. nMaxPoints maxima are searched, also applying a non maximum suppression, and sorting the candiates in decreasing order.

The interest points must fulfill the quality constraint specified by fQualityLevel. Two interest points must have a distance of at least fMinDistance.

All interest points are computed with pixel accuracy.

Parameters:
pInputImageThe input image. Must be of type CByteImage::eGrayScale.
pInterestPointsThe memory area for the interest points to be computed. Must provide space for at least nMaxPoints instances of Vec2d.
nMaxPointsThe maximum number of interest points to determine.
fQualityLevelThe algorithm determines the interest point with the maximum cornerness value first. fQualityLevel is multiplied with the maximum cornerness value, yielding a minimum quality constraint.
fMinDistanceThe minimum Euclidean distance two computed interest points must have.
Returns:
the number of interest points found. If an error occurs -1 is returned.

Definition at line 6918 of file ImageProcessor.cpp.

bool ImageProcessor::CalculateHarrisMap ( const CByteImage pInputImage,
CIntImage pOutputImage 
)

Calculates the Harris cornerness measure for every pixel in a CByteImage and writes the results to a CIntImage.

The cornerness value is defined as $ c = det(C) - \kappa \cdot {trace(C)}^2 $ where C is the covariance matrix for a given pixel location and observation windows and $ \kappa = 0.04 $. As observation window a 3x3 windows is used.

The width and height of pInputImage and pOutputImage must match. pInputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image. Must be of type CByteImage::eGrayScale.
pOutputImageThe output image.

Definition at line 6809 of file ImageProcessor.cpp.

bool ImageProcessor::CalculateIntegralImage ( const CByteImage pInputImage,
CIntImage pIntegralImage 
)

Calculates the integral image of a grayscale CByteImage and writes the result to a CIntImage.

In the integral image, each value is the sum of all values in pInputImage left and above of it, i.e. $ {\rm IntegralImage}_{x, y} = \sum_{i=0}^x \sum_{j=0}^y I_{i, j} $.

If the input image size is so large that overflows can occur, CalculateBinarizedSummedAreaTable(const CByteImage*, CIntImage*) should be caled. For example, the maximum value for a 1024x768 image is 1024 * 768 * 255 = 200540160 < 2147483647 = INT_MAX, which is ok. Overflows will occur approximately for images with more than 8 megapixels.

Parameters:
pInputImageThe input image. Must be of type CByteImage::eGrayScale:
pIntegralImageThe output image.

Definition at line 6231 of file ImageProcessor.cpp.

bool ImageProcessor::CalculateReverseSummedAreaTable ( const CIntImage pSummedAreaTable,
CByteImage pOutputImage 
)

Reconstructs the original image, given a summed area table, and writes the result to a grayscale CByteImage.

The original image pSummedAreaTable was computed for (applying CalculateSummedAreaTable(const CByteImage*, CIntImage*) or CalculateIntegralImage(const CByteImage*, CIntImage*)) is reconstructed.

Parameters:
pSummedAreaTableThe summed area table (resp. integral image).
pOutputImageThe result image (reconstructed image). Must be of type CByteImage::eGrayScale.

Definition at line 6340 of file ImageProcessor.cpp.

bool ImageProcessor::CalculateSaturationImage ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Calculates the saturation image for an RGB CByteImage and writes the result to a CByteImage.

Computes the saturation image (S-channel of the HSV image) of pInputImage and writes the result to pOutputImage.

The width and height of pInputImage and pOutputImage must match.

Parameters:
pInputImageThe input image. Must be of type CByteImage::eRGB24.
pOutputImageThe output image. Must be of type CByteImage::eGrayScale.

Definition at line 3853 of file ImageProcessor.cpp.

bool ImageProcessor::CalculateSummedAreaTable ( const CByteImage pInputImage,
CIntImage pSummedAreaTable 
)

Calculates the summed area table of a grayscale CByteImage and writes the result to a CIntImage.

This function performs the same as CalculateIntegralImage - two different names are available only to simplify searching for the functionality.

In the summed area table each value is the sum of all values in pInputImage left and above of it, i.e. $ {\rm SummedAreaTable}_{x, y} = \sum_{i=0}^x \sum_{j=0}^y I_{i, j} $.

If the input image size is so large that overflows can occur, CalculateBinarizedSummedAreaTable(const CByteImage*, CIntImage*) should be caled. For example, the maximum value for a 1024x768 image is 1024 * 768 * 255 = 200540160 < 2147483647 = INT_MAX, which is ok. Overflows will occur approximately for images with more than 8 megapixels.

Parameters:
pInputImageThe input image. Must be of type CByteImage::eGrayScale.
pSummedAreaTableThe output image.

Definition at line 6274 of file ImageProcessor.cpp.

bool ImageProcessor::Canny ( const CByteImage pInputImage,
CByteImage pOutputImage,
int  nLowThreshold,
int  nHighThreshold 
)

Applies the Canny edge detector to a CByteImage and writes the result to a CByteImage.

In pOutputImage, edge pixels will be encoded with the value 255, all other pixels with the value 0.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be both of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
nLowThresholdThe low threshold for the Canny edge detector.
nHighThresholdThe high threshold for the Canny edge detector.

Definition at line 6486 of file ImageProcessor.cpp.

bool ImageProcessor::Canny ( const CByteImage pInputImage,
CVec2dArray resultPoints,
CVec2dArray resultDirections,
int  nLowThreshold,
int  nHighThreshold 
)

Applies the Canny edge detector to a CByteImage and writes the edge pixels and directions to two instances of CVec2dArray.

This function computes edge pixels with subpixel accuracy as well as the edge direction for each edge pixel.

Parameters:
pInputImageThe input image. Must be of type CByteImage::eGrayScale.
resultPointsResult list containing edge points with subpixel accuracy.
resultDirectionsResult list containing gradient directions. Entries with the same index match between resultPoints and resultDirections.
nLowThresholdThe low threshold for the Canny edge detector.
nHighThresholdThe high threshold for the Canny edge detector.

Definition at line 6677 of file ImageProcessor.cpp.

bool ImageProcessor::ConvertBayerPattern ( const CByteImage pInputImage,
CByteImage pOutputImage,
BayerPatternType  type 
)

Converts an 8 bit Bayer pattern CByteImage to an RGB24 color CByteImage.

This function computes the RGB24 color image for a given 8 bit grayscale image containing the raw data of a Bayer pattern.

Parameters:
pInputImageThe input image. Must be of type CByteImage::eGrayScale.
pOutputImageThe output image. Must be of type CByteImage::eRGB24.
typeThe type of Bayer pattern assumed for processing. See BayerPatternType for further information.

Definition at line 7548 of file ImageProcessor.cpp.

bool ImageProcessor::ConvertImage ( const CByteImage pInputImage,
CByteImage pOutputImage,
bool  bFast = false,
const MyRegion pROI = 0 
)

Converts a grayscale CByteImage to an RGB CByteImage image and vice versa.

The RGB image can be of type CByteImage::eRGB24 or CByteImage::eRGB24Split.
If pInputImage->type and pOutputImage->type are equal, the input image is copied to the output image.

The width and height of pInputImage and pOutputImage must match.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
bFastIf true, a fast bit shift implementation of g = (r + 2 * g + b + 2) / 4 is used, otherwise an approximation of 0.299 * r + 0.587 * g + 0.114 * b using integer arithmetics is used.
pROIDescribes the area containing the pixels which shall be converted. If pROI is 0, then the whole image is processed.

Definition at line 2139 of file ImageProcessor.cpp.

bool ImageProcessor::ConvertImage ( const CFloatImage pInputImage,
CByteImage pOutputImage,
bool  equalize = false 
)

Converts a CFloatImage to a CByteImage.

Converts pInputImage to pOutputImage by casting the float values to unsigned char.

The dimension and channel number of pInputImage must match the dimension channel number of pOutputImage.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
equalizeIf set to true, the input values are equalized.

Definition at line 2359 of file ImageProcessor.cpp.

bool ImageProcessor::ConvertImage ( const CByteImage pInputImage,
CFloatImage pOutputImage 
)

Converts a CByteImage to a CFloatImage.

Converts pInputImage to pOutputImage by casting the unsigned char values to float.

The dimension and channel number of pInputImage must match the dimension channel number of pOutputImage.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 2463 of file ImageProcessor.cpp.

bool ImageProcessor::ConvertImage ( const CFloatMatrix pInputImage,
CByteImage pOutputImage 
)

Converts a CFloatMatrix to a grayscale CByteImage.

Converts pInputImage to pOutputImage by linearly mapping the interval [min, max] to [0, 255], where min/max are the minimum/maximum value in pInputImage. This conversion can cause a loss of information.
If pInputImage is homogeneous, the values of pOutputImage are all set to zero.

The column count of pInputImage must match the width of pOutputImage and the row count of pInputImage must match the height of pOutputImage.
pOutputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 2503 of file ImageProcessor.cpp.

bool ImageProcessor::ConvertImage ( const CByteImage pInputImage,
CFloatMatrix pOutputImage 
)

Converts a grayscale CByteImage to a CFloatMatrix.

Converts pInputImage to pOutputImage by casting the unsigned char values to float.

The width of pInputImage must match the column count of pOutputImage and the height of pInputImage must match the row count of pOutputImage.
pInputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 2543 of file ImageProcessor.cpp.

bool ImageProcessor::ConvertImage ( const CShortImage pInputImage,
CByteImage pOutputImage 
)

Converts a CShortImage to a grayscale CByteImage.

Converts pInputImage to pOutputImage by linearly mapping the interval [min, max] to [0, 255], where min/max are the minimum/maximum value in pInputImage. This conversion can cause a loss of information.
If pInputImage is homogeneous, the values of pOutputImage are all set to zero.

The width and height of pInputImage and pOutputImage must match.
pOutputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 2561 of file ImageProcessor.cpp.

bool ImageProcessor::ConvertImage ( const CByteImage pInputImage,
CShortImage pOutputImage 
)

Converts a grayscale CByteImage to a CShortImage.

Converts pInputImage to pOutputImage by casting the unsigned char values to short.

The width and height of pInputImage and pOutputImage must match.
pInputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 2599 of file ImageProcessor.cpp.

bool ImageProcessor::ConvertImage ( const CIntImage pInputImage,
CByteImage pOutputImage 
)

Converts a CIntImage to a grayscale CByteImage.

Converts pInputImage to pOutputImage by linearly mapping the interval [min, max] to [0, 255], where min/max are the minimum/maximum value in pInputImage. This conversion can cause a loss of information.
If pInputImage is homogeneous, the values of pOutputImage are all set to zero.

The width and height of pInputImage and pOutputImage must match.
pOutputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 2635 of file ImageProcessor.cpp.

bool ImageProcessor::ConvertImage ( const CByteImage pInputImage,
CIntImage pOutputImage 
)

Converts a grayscale CByteImage to a CIntImage.

Converts pInputImage to pOutputImage by casting the unsigned char values to int.

The width and height of pInputImage and pOutputImage must match.
pInputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 2617 of file ImageProcessor.cpp.

bool ImageProcessor::ConvertMatrix ( const CFloatMatrix pInputImage,
CDoubleMatrix pOutputImage 
)

Converts a CFloatMatrix to a CDoubleMatrix.

Converts pInputImage to pOutputImage by casting the float values to double.

The row count and the column count of pInputImage and pOutputImage must match.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 2674 of file ImageProcessor.cpp.

bool ImageProcessor::ConvertMatrix ( const CDoubleMatrix pInputImage,
CFloatMatrix pOutputImage 
)

Converts a CDoubleMatrix to a CFloatMatrix.

Converts pInputImage to pOutputImage by casting the double values to float. This conversion can cause a loss of precision.

The row count and the column count of pInputImage and pOutputImage must match.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 2692 of file ImageProcessor.cpp.

bool ImageProcessor::CopyFrame ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Copies all pixels on a one pixel wide frame from one CByteImage to CByteImage.

The frame consists of the top and bottom row as well as the leftmost and rightmost column.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be either both of type CByteImage::eGrayScale or both of type CByteImage::eRGB24.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 3092 of file ImageProcessor.cpp.

bool ImageProcessor::CopyImage ( const CByteImage pInputImage,
CByteImage pOutputImage,
const MyRegion pROI = 0,
bool  bUseSameSize = false 
)

Copies one CByteImage to another.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
pROIDescribes the area containing the pixels which shall be copied. If pROI is 0, then the full image is copied.
bUseSameSizeThis parameter is only relevant if pROI is not 0. If bUseSameSize is true, the width and height of pInputImage and pOutputImage must match. Otherwise, the dimensions of pROI and pOutputImage must match, i.e. pROI->max_x - pROI->min_x + 1 = pOutputImage->width and pROI->max_y - pROI->min_y + 1 = pOutputImage->height.

Definition at line 2711 of file ImageProcessor.cpp.

bool ImageProcessor::CopyImage ( const CShortImage pInputImage,
CShortImage pOutputImage,
const MyRegion pROI = 0,
bool  bUseSameSize = false 
)

Copies one CShortImage to another.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
pROIDescribes the area containing the pixels which shall be copied. If pROI is 0, then the full image is copied.
bUseSameSizeThis parameter is only relevant if pROI is not 0. If bUseSameSize is true, the width and height of pInputImage and pOutputImage must match. Otherwise, the dimensions of pROI and pOutputImage must match, i.e. pROI->max_x - pROI->min_x + 1 = pOutputImage->width and pROI->max_y - pROI->min_y + 1 = pOutputImage->height.

Definition at line 2832 of file ImageProcessor.cpp.

bool ImageProcessor::CopyMatrix ( const CFloatMatrix pInputImage,
CFloatMatrix pOutputImage 
)

Copies one CFloatMatrix to another.

The row count and the column count of pInputImage and pOutputImage must match.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 2912 of file ImageProcessor.cpp.

bool ImageProcessor::CopyMatrix ( const CDoubleMatrix pInputImage,
CDoubleMatrix pOutputImage 
)

Copies one CDoubleMatrix to another.

The row count and the column count of pInputImage and pOutputImage must match.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 2925 of file ImageProcessor.cpp.

bool ImageProcessor::DetermineAffineTransformation ( const Vec2d pSourcePoints,
const Vec2d pTargetPoints,
int  nPoints,
float &  a1,
float &  a2,
float &  a3,
float &  a4,
float &  a5,
float &  a6 
)

Deprecated.

Deprecated:

This function is deprecated. It calls LinearAlgebra::DetermineAffineTransformation; please refer to the documentation of this function for more information.

Definition at line 5399 of file ImageProcessor.cpp.

bool ImageProcessor::DetermineHomography ( const Vec2d pSourcePoints,
const Vec2d pTargetPoints,
int  nPoints,
float &  a1,
float &  a2,
float &  a3,
float &  a4,
float &  a5,
float &  a6,
float &  a7,
float &  a8 
)

Deprecated.

Deprecated:

This function is deprecated. It internally calls LinearAlgebra::DetermineHomography; please refer to the documentation of this function for more information.

Definition at line 5379 of file ImageProcessor.cpp.

bool ImageProcessor::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 CByteImage.

A morphological dilate operation with a squared structure element is applied. The input image is assumed to encode background with the value 0 and foreground with 255. The output image will be encoded in the same way.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be both of type CByteImage::eGrayScale.

If pInputImage and pOutputImage share the same memory area, the input image is copied to a temporary image first.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
nMaskSizeDetermines the size of the structure element. A squared structure element of size nMaskSize x nMaskSize is used. nMaskSize must be an uneven number greater or equal 3.
pROIDescribes the area containing the pixels on which the operation shall be executed. If pROI is 0, then the whole image is processed.

Definition at line 1687 of file ImageProcessor.cpp.

bool ImageProcessor::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 CByteImage.

A morphological erode operation with a squared structure element is applied. The input image is assumed to encode background with the value 0 and foreground with 255. The output image will be encoded in the same way.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be both of type CByteImage::eGrayScale.

If pInputImage and pOutputImage share the same memory area, the input image is copied to a temporary image first.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
nMaskSizeDetermines the size of the structure element. A squared structure element of size nMaskSize x nMaskSize is used. nMaskSize must be an uneven number greater or equal 3.
pROIDescribes the area containing the pixels on which the operation shall be executed. If pROI is 0, then the whole image is processed.

Definition at line 1816 of file ImageProcessor.cpp.

bool ImageProcessor::FindRegions ( const CByteImage pImage,
RegionList regionList,
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.

It is recommended to use the function FindRegions(const CByteImage*, CRegionArray&, int, int, bool, bool) instead. The only difference is the type of the parameter regionList, which is a std::vector<MyRegion> here and a CDynamicArrayTemplate<MyRegion> in the other case, which is more efficient.

This function chooses every foreground pixel as seed point and performs a region growing (4-connectivity) by calling the function RegionGrowing(const CByteImage*, MyRegion&, int, int, int, int, bool, bool). Already visited pixels are marked so that only not unvisited pixels can serve as seed points.

The input image is assumed to encode background with the value 0 and foreground with the value 255.

Parameters:
pImageThe input image. Must be a binary image of type CByteImage::eGrayScale.
regionListThe list of regions. RegionList is a typedef for std::vector<MyRegion>.
nMinimumPointsPerRegionSpecifies the minimum number of pixels the region must contain. The default value nMinimumPointsPerRegion = 0 means that no lower bound is checked.
nMaximumPointsPerRegionSpecifies the maximum number of pixels the region may contain. The default value nMaximumPointsPerRegion = 0 means that no upper bound is checked.
bCalculateBoundingBoxCalculate bounding box (members min_x, min_y, max_x, max_y, ratio of MyRegion) or not. Setting bCalculateBoundingBox to false saves computation time.
bStorePixelsStore pixels belonging to the region in the member MyRegion::pPixels. Memory is handled automatically (allocation/deletion). Setting bStorePixels to false saves computation time.

Definition at line 4473 of file ImageProcessor.cpp.

bool ImageProcessor::FindRegions ( const CByteImage pImage,
CRegionArray regionList,
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.

This function chooses every foreground pixel as seed point and performs a region growing (4-connectivity) by calling the function RegionGrowing(const CByteImage*, MyRegion&, int, int, int, int, bool, bool). Already visited pixels are marked so that only not unvisited pixels can serve as seed points.

The input image is assumed to encode background with the value 0 and foreground with the value 255.

Parameters:
pImageThe input image. Must be a binary image of type CByteImage::eGrayScale.
regionListThe list of regions. CRegionArray is a typedef for CDynamicArrayTemplate<MyRegion>.
nMinimumPointsPerRegionSpecifies the minimum number of pixels the region must contain. The default value nMinimumPointsPerRegion = 0 means that no lower bound is checked.
nMaximumPointsPerRegionSpecifies the maximum number of pixels the region may contain. The default value nMaximumPointsPerRegion = 0 means that no upper bound is checked.
bCalculateBoundingBoxCalculate bounding box (members min_x, min_y, max_x, max_y, ratio of MyRegion) or not. Setting bCalculateBoundingBox to false saves computation time.
bStorePixelsStore pixels belonging to the region in the member MyRegion::pPixels. Memory is handled automatically (allocation/deletion). Setting bStorePixels to false saves computation time.

Definition at line 4564 of file ImageProcessor.cpp.

bool ImageProcessor::FlipY ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Flips the rows in a CByteImage vertically and writes the result to a CByteImage.

Flips the rows in pInputImage vertically, i.e. mirros the image with the center axis, and writes the result to pOutputImage.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be either both of type CByteImage::eGrayScale or both of type CByteImage::eRGB24.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 6143 of file ImageProcessor.cpp.

bool ImageProcessor::GaussianSmooth ( const CByteImage pInputImage,
CFloatMatrix pOutputImage,
float  fVariance,
int  nKernelSize 
)

Applies a Gaussian filter to a CByteImage and writes the result to a CFloatMatrix.

Applies a Gaussian filter of size nKernelSize x nKernelSize to pInputImage and writes the result to pOutputImage.

The width and height of pInputImage must match the row and column count of pOutputImage. The image size must be at least nKernelSize x nKernelSize.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
fVarianceThe variance $ \sigma^2 $ used for constructing the Gaussian kernel.
nKernelSizeDetermines the side the length of the Gaussian kernel used for smoothing. It should meet the following criterion: $ {\rm nKernelSize} \geq \lfloor 2\sigma \rfloor \cdot 2 + 1 $ to achieve a meaningful approximation.

Definition at line 5780 of file ImageProcessor.cpp.

bool ImageProcessor::GaussianSmooth ( const CFloatMatrix pInputImage,
CFloatMatrix pOutputImage,
float  fVariance,
int  nKernelSize 
)

Applies a Gaussian filter to a CFloatMatrix and writes the result to a CFloatMatrix.

Applies a Gaussian filter of size nKernelSize x nKernelSize to pInputImage and writes the result to pOutputImage.

The row and column count of pInputImage and pOutputImage must match. The image size must be at least nKernelSize x nKernelSize.

pInputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
fVarianceThe variance $ \sigma^2 $ used for constructing the Gaussian kernel.
nKernelSizeDetermines the size of the Gaussian kernel used for smoothing. It should meet the following criterion: $ {\rm nKernelSize} \geq \lfloor 2\sigma \rfloor \cdot 2 + 1 $ to achieve a meaningful approximation.

Definition at line 5919 of file ImageProcessor.cpp.

bool ImageProcessor::GaussianSmooth ( const CByteImage pInputImage,
CByteImage pOutputImage,
float  fVariance,
int  nKernelSize 
)

Applies a Gaussian filter to a CByteImage and writes the result to a CByteImage.

Applies a Gaussian filter of size nKernelSize x nKernelSize to pInputImage and writes the result to pOutputImage.

The width and height of pInputImage and pOutputImage must match. The image size must be at least nKernelSize x nKernelSize.

pInputImage and pOutputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
fVarianceThe variance $ \sigma^2 $ used for constructing the Gaussian kernel.
nKernelSizeDetermines the size of the Gaussian kernel used for smoothing. It should meet the following criterion: $ {\rm nKernelSize} \geq \lfloor 2\sigma \rfloor \cdot 2 + 1 $ to achieve a meaningful approximation.

Definition at line 5641 of file ImageProcessor.cpp.

bool ImageProcessor::GaussianSmooth3x3 ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Applies a 3x3 Gaussian filter to a CByteImage and writes the result to a CByteImage.

Applies a 3x3 Gaussian low pass filter with $ \sigma \approx 0.85 $, i.e. variance = $ \sigma^2 \approx 0.85^2 $, to pInputImage and writes the result to pOutputImage. The used filter kernel is: $ \frac{1}{16}\left(\begin{array}{ccc} 1 & 2 & 1\\ 2 & 4 & 2\\ 1 & 2 & 1\\ \end{array}\right) $.

All calculations are performed with integer arithmetics.

The width and height of pInputImage and pOutputImage must match. The image size must be at least 3 x 3.

pInputImage and pOutputImage must be either both of type CByteImage::eGrayScale or both of type CByteImage::eRGB24.

If pInputImage and pOutputImage share the same memory area, the input image is copied to a temporary image first.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 746 of file ImageProcessor.cpp.

bool ImageProcessor::GaussianSmooth5x5 ( const CFloatMatrix pInputImage,
CFloatMatrix pOutputImage,
float  fVariance 
)

Applies a 5x5 Gaussian filter to a CFloatMatrix and writes the result to a CFloatMatrix.

This is an optimized implementation of GaussianSmooth(const CFloatMatrix *pInputImage, CFloatMatrix *pOutputImage, float fVariance, int nKernelSize) for the special case of a 5x5 kernel, i.e. nKernelSize = 5.

The row and column count of pInputImage and pOutputImage must match. The image size must be at least 5 x 5.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
fVarianceThe variance $ \sigma^2 $ used for constructing the Gaussian kernel. According to the formula $ n \geq \lfloor 2\sigma \rfloor \cdot 2 + 1 $ (where n denotes the side length of the filter kernel, i.e. n = 5 for this function), it must be $ \sigma^2 < 1.5^2 $.

Definition at line 5502 of file ImageProcessor.cpp.

bool ImageProcessor::GaussianSmooth5x5 ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Applies a 5x5 Gaussian filter to a CByteImage and writes the result to a CByteImage.

Applies a 5x5 Gaussian filter with $ \sigma \approx 0.9 $, i.e. variance = $ \sigma^2 \approx 0.9^2 $, to pInputImage and writes the result to pOutputImage. The used filter kernel is: $ \frac{1}{256}\left(\begin{array}{ccccc} 1 & 4 & 6 & 4 & 1\\ 4 & 16 & 24 & 16 & 4\\ 6 & 24 & 36 & 24 & 6\\ 4 & 16 & 24 & 16 & 4\\ 1 & 4 & 6 & 4 & 1 \end{array}\right) $.

All calculations are performed with integer arithmetics.

The width and height of pInputImage and pOutputImage must match. The image size must be at least 5 x 5.

All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 534 of file ImageProcessor.cpp.

bool ImageProcessor::GeneralFilter ( const CByteImage pInputImage,
CByteImage pOutputImage,
const int *  pKernel,
int  nMaskSize,
int  nDivider = 1,
bool  bAbsoluteValue = false 
)

Applies a user defined filter to a CByteImage and writes the result to a CByteImage.

Applies a user defined filter of size nMaskSize x nMaskSize to pInputImage and writes the result to pOutputImage. Overflows are not handled. Use the functions GeneralFilter(const CByteImage*, CShortImage*, const int*, int, int, bool) or GeneralFilter(const CByteImage*, CFloatMatrix*, const int*, int, int, bool), if overflows can potentially occur for the desired kernel or for higher precision.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be of type CByteImage::eGrayScale.

If pInputImage and pOutputImage share the same memory area, the input image is copied to a temporary image first.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
pKernelThe filter kernel. The coefficients are expected to be stored row wise, starting from the top left corner.
nMaskSizeThe side length of the filter kernel. Must be an odd integer greater than 2.
nDividerEach value is divided by nDivider before it is written to pOutputImage. If nDivider = 1, then the division is omitted, thus saving computation time.
bAbsoluteValueIf true, the absolute values are written to pOutputImage.

Definition at line 164 of file ImageProcessor.cpp.

bool ImageProcessor::GeneralFilter ( const CByteImage pInputImage,
CShortImage pOutputImage,
const int *  pKernel,
int  nMaskSize,
int  nDivider = 1,
bool  bAbsoluteValue = false 
)

Applies a user defined filter to a CByteImage and writes the result to a CShortImage.

Applies a user defined filter of size nMaskSize x nMaskSize to pInputImage and writes the result to pOutputImage. Overflows are not handled. Use the function GeneralFilter(const CByteImage*, CFloatMatrix*, const int*, int, int, bool) for higher precision.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
pKernelThe filter kernel. The coefficients are expected to be stored row wise, starting from the top left corner.
nMaskSizeThe side length of the filter kernel. Must be an odd integer greater than 2.
nDividerEach value is divided by nDivider before it is written to pOutputImage. If nDivider = 1, then the division is omitted, thus saving computation time.
bAbsoluteValueIf true, the absolute values are written to pOutputImage.

Definition at line 284 of file ImageProcessor.cpp.

bool ImageProcessor::GeneralFilter ( const CByteImage pInputImage,
CFloatMatrix pOutputImage,
const int *  pKernel,
int  nMaskSize,
int  nDivider = 1,
bool  bAbsoluteValue = false 
)

Applies a user defined filter to a CByteImage and writes the result to a CFloatMatrix.

Applies a user defined filter of size nMaskSize x nMaskSize to pInputImage and writes the result to pOutputImage.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
pKernelThe filter kernel. The coefficients are expected to be stored row wise, starting from the top left corner.
nMaskSizeThe side length of the filter kernel. Must be an odd integer greater than 2.
nDividerEach value is divided by nDivider before it is written to pOutputImage. If nDivider = 1, then the division is omitted, thus saving computation time.
bAbsoluteValueIf true, the absolute values are written to pOutputImage.

Definition at line 393 of file ImageProcessor.cpp.

int ImageProcessor::GetAreaSum ( const CIntImage pIntegralImage,
int  min_x,
int  min_y,
int  max_x,
int  max_y 
)

Efficiently computes the sum of all pixel values in a rectangular area using integral image lookups.

This function efficiently computes $ \sum_{i=min_x}^{max_x}\sum_{j=min_y}^{max_y} I_{i, j} $ using four memory lookups, where $I$ denotes the original image the integral image was computed for. The integral image for a given grayscale CByteImage can be computed by calling the function CalculateIntegralImage(const CByteImage*, CIntImage*).

This function performs checking of bounds. For maximum speed, GetAreaSumNoChecks(const pIntegralImage*, int, int, int, int) is recommended, which, however, does not perform any bounds checking and requires min_x >= 1 and min_y >= 1.

Parameters:
pIntegralImageThe integral image.
min_xThe x-coordinate of the upper left corner of the rectangular region. Must be >= 0.
min_yThe y-coordinate of the upper left corner of the rectangular region. Must be >= 0.
max_xThe x-coordinate of the lower right corner of the rectangular region. Must be < pInputImage->width.
max_yThe y-coordinate of the lower right corner of the rectangular region. Must be < pInputImage->height.

Definition at line 6383 of file ImageProcessor.cpp.

int ImageProcessor::GetAreaSum ( const CIntImage pIntegralImage,
const MyRegion pRegion 
)

Efficiently computes the sum of all pixel values in a rectangular area using integral image lookups.

This is a convenience function, calling GetAreaSum(const CIntImage*, int, int, int, int).

Parameters:
pIntegralImageThe integral image.
pRegionThe region entry that specifies the region of interest.

Definition at line 6420 of file ImageProcessor.cpp.

int ImageProcessor::GetAreaSumNoChecks ( const CIntImage pIntegralImage,
int  min_x,
int  min_y,
int  max_x,
int  max_y 
) [inline]

Efficiently computes the sum of all pixel values in a rectangular area using integral image lookups.

This function computes $ \sum_{i=min_x}^{max_x}\sum_{j=min_y}^{max_y} I_{i, j} $ using an precomputed integral image.

This functions does not perform any bounds checks and requires min_x >= 1 and min_y >= 1. If min_x = 0 and min_y = 0 are relevant or bounds checking is required, the function GetAreaSum(const pIntegralImage*, int, int, int, int) should be used, which is, however, slightly slower.

Parameters:
pIntegralImageThe integral image.
min_xThe x-coordinate of the upper left corner of the rectangular region. Must be >= 1.
min_yThe y-coordinate of the upper left corner of the rectangular region. Must be >= 1.
max_xThe x-coordinate of the lower right corner of the rectangular region. Must be < pInputImage->width.
max_yThe y-coordinate of the lower right corner of the rectangular region. Must be < pInputImage->height.

Definition at line 6408 of file ImageProcessor.cpp.

bool ImageProcessor::HighPassX3 ( const CFloatMatrix pInputImage,
CFloatMatrix pOutputImage 
)

Applies a 1x3 highpass filter to a CFloatMatrix and write the result to a CFloatMatrix.

This is a simple highpass filter computing gradients in x-direction and is thus suitable for the detection of vertical edges. The used filter kernel is: $ \left( \begin{array}{ccc} 1 & 0 & -1 \\ \end{array} \right) $.

The row and column count of pInputImage and pOutputImage must match.

If pInputImage and pOutputImage share the same memory area, the input image is copied to a temporary image first.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 6058 of file ImageProcessor.cpp.

bool ImageProcessor::HighPassY3 ( const CFloatMatrix pInputImage,
CFloatMatrix pOutputImage 
)

Applies a 3x1 highpass filter to a CFloatMatrix and writes the result to a CFloatMatrix.

This is a simple highpass filter computing gradients in y-direction and is thus suitable for the detection of horizontal edges. The used filter kernel is: $ \left( \begin{array}{c} 1 \\ 0 \\ -1 \\ \end{array}\right) $.

The row and column count of pInputImage and pOutputImage must match.

If pInputImage and pOutputImage share the same memory area, the input image is copied to a temporary image first.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 6101 of file ImageProcessor.cpp.

bool ImageProcessor::HistogramEqualization ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Performs histogram equalization for a CByteImage and writes the result to a CByteImage.

Performs histogram equalization by computing the accumulated histogram $H_a$ for input image and using the following mapping function for writing pOutputImage: $I_{out}(x, y) = \frac{255}{n} \cdot H_a(I_{in}(x, y))$, where n denotes the number of pixels contained in pInputImage (resp. pOutputImage).

The width and height of pInputImage and pOutputImage must match.
Both images must be of type CByteImage::eGrayScale.

As this is a point operation, there is no copy overhead if pInputImage and pOutputImage share the same memory area.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 1958 of file ImageProcessor.cpp.

bool ImageProcessor::HistogramStretching ( const CByteImage pInputImage,
CByteImage pOutputImage,
float  p1 = 0.1f,
float  p2 = 0.9f 
)

Performs histogram stretching on pInputImage and stores the result in pOutputImage.

Linearly maps the interval [min, max] to [0, 255], where min/max are the two peaks of the histogram determined with the aid of a quantile analysis, assuming a bimodal histogram.
If pInputImage is homogeneous, the values of pOutputImage are all set to zero.

The width and height of pInputImage and pOutputImage must match.
Both images must be of type CByteImage::eGrayScale.

As this is a point operation, there is no copy overhead if pInputImage and pOutputImage share the same memory area.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
p1The quantile used for determining the position of the first peak in the histogram (minimum intensity).
p2The quantile used for determining the position of the second peak in the histogram (maximum intensity).

Definition at line 2058 of file ImageProcessor.cpp.

bool ImageProcessor::HoughTransformCircles ( const CByteImage pImage,
CByteImage pVisualizationImage,
Vec3dList resultCircles,
int  rmin,
int  rmax,
int  nCirclesToExtract,
int  nMinHits = 1 
)

Performs the Hough transform for circles on a CByteImage.

This function implements the standard form of the Hough transform, which does not incorporate the edge directions in the voting algorithm. For more efficient and more precise circle detection it is recommended to use the function HoughTransformCircles(const CVec2dArray&, const CVec2dArray&, int, int, int, int, int, int, CVec3dArray&, CIntArray&, CByteImage*).

As input a binary image is assumed in pImage, where background pixels are encoded with the value 0 and foreground pixels are encoded with non-zero values (usually 255). It is recommended to use the function Canny(const CByteImage*, CByteImage*, int, int) to produce the input image for this function.

Circles are represented by the equations $ u = u_m + r \cdot cos(\theta) $ and $ v = v_m + r \cdot sin(\theta) $.

Parameters:
pImageThe input image. Must be a binary image of type CByteImage::eGrayScale.
pVisualizationImageIf pVisualizationImage is not NULL, the recognized circles will be drawn in this image.
resultCirclesThe list of recognized circles in pImage represented by tuples $(u_m, v_m, r)$ ( $u_m$ = Vec3d::x, $v_m$ = Vec3d::y, $r$ = Vec3d::z) according to the equations explained above. The function PrimitivesDrawer::DrawCircle(CByteImage*, float, float, float, int, int, int, int, bool) can be used for drawing circles specified by these parameters.
rminThe minimum radius. The smaller this value, the greater is the computational effort.
rmaxThe maximum radius. The greater this value, the greater is the computatoinal effort.
nCirclesToExtractAt most nCirclesToExtract circles are extracted. The greater this value, the greater is the computational effort.
nMinHitsThe minimum number of votes a circle needs to receive before being recognized as a circle.

Definition at line 4977 of file ImageProcessor.cpp.

bool ImageProcessor::HoughTransformCircles ( const CVec2dArray edgePoints,
const CVec2dArray edgeDirections,
int  width,
int  height,
int  rmin,
int  rmax,
int  nCirclesToExtract,
int  nMinHits,
CVec3dArray resultCircles,
CIntArray resultHits,
CByteImage pVisualizationImage = 0 
)

Performs the Hough transform for circles, given a list of edge points and directions.

This function implements an improved form of the Hough transform, which also incorporates the edge directions in the voting algorithm. The standard version of the Hough transform for straight lines is implemented in HoughTransformCircles(const CByteImage*, CByteImage*, Vec3dList&, int, int, int, int).

As input lists with edge points and edge directions are required. It is recommended to use the function Canny(const CByteImage*, CVec2dArray&, CVec2dArray&, int, int) to produce these input lists for this function.

Circles are represented by the equations $ u = u_m + r \cdot cos(\theta) $ and $ v = v_m + r \cdot sin(\theta) $.

It is recommended to use the function ImageProcessor::HoughTransformLines(const CVec2dArray&, const CVec2dArray&, int, int, int, int, CCircle2dArray&, CIntArray&, CByteImage*).

Parameters:
edgePointsThe list containing the edge points.
edgeDirectionsThe list containing the edge directions. Must be of same size as the parameter edgePoints and entries with same index must correspond.
widthThe width of the image the edge points/directions were computed for.
heightThe height of the image the edge points/directions were computed for.
rminThe minimum radius. The smaller this value, the greater is the computational effort.
rmaxThe maximum radius. The greater this value, the greater is the computatoinal effort.
nCirclesToExtractAt most nCirclesToExtract circles are extracted. The greater this value, the greater is the computational effort.
nMinHitsThe minimum number of votes a circle needs to receive before being recognized as a circle.
resultCirclesThe list of recognized circles, represented by tuples $ (u_m, v_m, r) $ ( $u_m$ = Vec3d::x, $v_m$ = Vec3d::y, $r$ = Vec3d::z) according to the equations explained above. The function PrimitivesDrawer::DrawCircle(CByteImage*, float, float, float, int, int, int, int, bool) can be used for drawing circles specified by these parameters.
resultHitsThe list containing the number of hits for corresponding entries in resultCircles.
pVisualizationImageIf pVisualizationImage is not NULL, the recognized circles will be drawn in here.

This function implements an improved form of the Hough transform, which also incorporates the edge directions in the voting algorithm. The standard version of the Hough transform for straight lines is implemented in HoughTransformCircles(const CByteImage*, CByteImage*, Vec3dList&, int, int, int, int).

As input lists with edge points and edge directions are required. It is recommended to use the function Canny(const CByteImage*, CVec2dArray&, CVec2dArray&, int, int) to produce these input lists for this function.

Circles are represented in terms of the struct Circle2d.

Parameters:
edgePointsThe list containing the edge points.
edgeDirectionsThe list containing the edge directions. Must be of same size as the parameter edgePoints and entries with same index must correspond.
widthThe width of the image the edge points/directions were computed for.
heightThe height of the image the edge points/directions were computed for.
rminThe minimum radius. The smaller this value, the greater is the computational effort.
rmaxThe maximum radius. The greater this value, the greater is the computatoinal effort.
nCirclesToExtractAt most nCirclesToExtract circles are extracted. The greater this value, the greater is the computational effort.
nMinHitsThe minimum number of votes a circle needs to receive before being recognized as a circle.
resultCirclesThe list of recognized circles, represented by instances of the struct Circle2d. The function PrimitivesDrawer::DrawLine(CByteImage*, const CCircle2d&, int, int, int, int bool) can be used for drawing circles specified by this struct.
resultHitsThe list containing the number of hits for corresponding entries in resultCircles.
pVisualizationImageIf pVisualizationImage is not NULL, the recognized circles will be drawn in here.

Definition at line 5223 of file ImageProcessor.cpp.

bool ImageProcessor::HoughTransformLines ( const CByteImage pImage,
CByteImage pVisualizationImage,
Vec2dList resultLines,
int  nLinesToExtract,
int  nMinHits = 1 
)

Performs the Hough transform for straight lines on a CByteImage.

This function implements the standard form of the Hough transform, which does not incorporate the edge directions in the voting algorithm. For more efficient and more precise line detection it is recommended to use the function HoughTransformLines(const CVec2dArray&, const CVec2dArray&, int, int, int, int, CVec2dArray&, CIntArray&, CByteImage*).

As input a binary image is assumed in pImage, where background pixels are encoded with the value 0 and foreground pixels are encoded with non-zero values (usually 255). It is recommended to use the function Canny(const CByteImage*, CByteImage*, int, int) to produce the input image for this function.

Lines are represented with by polar coordinates: $ r = u \cdot cos(\theta) + v \cdot sin(\theta) $, where (u, v) denote image coordinates, $\theta$ is the angle of the normal vector and r is the distance of the line to the origin.

Parameters:
pImageThe input image. Must be a binary image of type CByteImage::eGrayScale.
pVisualizationImageIf pVisualizationImage is not NULL, the recognized lines will be drawn in this image.
resultLinesThe list of recognized lines represented by tuples $ (\theta, r) $ ( $\theta$ = Vec2d::x, $r$ = Vec2d::y) according to the polar coordinate form explained above. The function PrimitivesDrawer::DrawLinePolar(CByteImage*, float, float, int, int, int) can be used for drawing lines specified by these parameters.
nLinesToExtractAt most nLinesToExtract lines are extracted. The greater this value, the greater is the computational effort.
nMinHitsThe minimum number of votes a line needs to receive before being recognized as a line.

Definition at line 4871 of file ImageProcessor.cpp.

void ImageProcessor::HoughTransformLines ( const CVec2dArray edgePoints,
const CVec2dArray edgeDirections,
int  width,
int  height,
int  nLinesToExtract,
int  nMinHits,
CVec2dArray resultLines,
CIntArray resultHits,
CByteImage pVisualizationImage = 0 
)

Performs the Hough transform for straight lines, given a list of edge points and directions.

This function implements an improved form of the Hough transform, which also incorporates the edge directions in the voting algorithm. The standard version of the Hough transform for straight lines is implemented in HoughTransformLines(const CByteImage*, CByteImage*, Vec2dList&, int, int).

As input lists with edge points and edge directions are required. It is recommended to use the function Canny(const CByteImage*, CVec2dArray&, CVec2dArray&, int, int) to produce these input lists for this function.

Lines are represented with the aid of polar coordinates: $ r = u \cdot cos(\theta) + v \cdot sin(\theta) $.

It is recommended to use the function ImageProcessor::HoughTransformLines(const CVec2dArray&, const CVec2dArray&, int, int, int, int, CStraightLine2dArray&, CIntArray&, CByteImage*).

Parameters:
edgePointsThe list containing the edge points.
edgeDirectionsThe list containing the edge directions. Must be of same size as the parameter edgePoints and entries with same index must correspond.
widthThe width of the image the edge points/directions were computed for.
heightThe height of the image the edge points/directions were computed for.
nLinesToExtractAt most nLinesToExtract lines are extracted. The greater this value, the greater is the computational effort.
nMinHitsThe minimum number of votes a line needs to receive before being recognized as a line.
resultLinesThe list of recognized lines, represented by tuples $ (\theta, r) $ ( $\theta$ = Vec2d::x, $r$ = Vec2d::y) according to the polar coordinate form explained above. The function PrimitivesDrawer::DrawLinePolar(CByteImage*, float, float, int, int, int) can be used for drawing lines specified by these parameters.
resultHitsThe list containing the number of hits for corresponding entries in resultLines.
pVisualizationImageIf pVisualizationImage is not NULL, the recognized lines will be drawn in here.

This function implements an improved form of the Hough transform, which also incorporates the edge directions in the voting algorithm. The standard version of the Hough transform for straight lines is implemented in HoughTransformLines(const CByteImage*, CByteImage*, Vec2dList&, int, int).

As input lists with edge points and edge directions are required. It is recommended to use the function Canny(const CByteImage*, CVec2dArray&, CVec2dArray&, int, int) to produce these input lists for this function.

Lines are represented in terms of the struct StraightLine2d.

Parameters:
edgePointsThe list containing the edge points.
edgeDirectionsThe list containing the edge directions. Must be of same size as the parameter edgePoints and entries with same index must correspond.
widthThe width of the image the edge points/directions were computed for.
heightThe height of the image the edge points/directions were computed for.
nLinesToExtractAt most nLinesToExtract lines are extracted. The greater this value, the greater is the computational effort.
nMinHitsThe minimum number of votes a line needs to receive before being recognized as a line.
resultLinesThe list of recognized lines, represented by instances of the struct StraightLine2d. The function PrimitivesDrawer::DrawLine(CByteImage*, const StraightLine2d&, int, int, int) can be used for drawing lines specified by this struct.
resultHitsThe list containing the number of hits for corresponding entries in resultLines.
pVisualizationImageIf pVisualizationImage is not NULL, the recognized lines will be drawn in here.

Definition at line 5097 of file ImageProcessor.cpp.

bool ImageProcessor::Invert ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Calculates the inverted image of a CByteImage and writes the result to a CByteImage.

Inverting is accomplished by calculating 255 - value for each byte value.

The width, height and type of pInputImage and pOutputImage must match. All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 2116 of file ImageProcessor.cpp.

bool ImageProcessor::Laplace1 ( const CByteImage pInputImage,
CShortImage pOutputImage,
bool  bAbsoluteValue = true 
)

Filters a CByteImage with the Laplace1 operator and writes the result to a CShortImage.

The Laplace1 operator is an omnidirectional high pass filter (edge filter). It is an approximation of a second order derivative. The used filter kernel is: $ \left(\begin{array}{ccc} 0 & 1 & 0 \\ 1 & -4 & 1 \\ 0 & 1 & 0 \\ \end{array}\right) $.

The width and height of pInputImage and pOutputImage must match.
pInputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
bAbsoluteValueIf true, the absolute values are written to pOutputImage.

Definition at line 1106 of file ImageProcessor.cpp.

bool ImageProcessor::Laplace1 ( const CByteImage pInputImage,
CByteImage pOutputImage,
bool  bAbsoluteValue = true 
)

Filters a CByteImage with the Laplace1 operator and writes the result to a CByteImage.

This function is a convenience function, creating an instance of CShortImage, calling Laplace1(const CByteImage*, CShortImage*, bool), and then calling ConvertImage(const CShortImage*, CByteImage*). See the documentations of these functions for further information. Note that there is no runtime penalty if pInputImage and pOutputImage share the same memory area, since a temporary instance of CShortImage is used for storing the result of the convolution in any case.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
bAbsoluteValueIf true, the absolute values are written to pOutputImage.

Definition at line 1082 of file ImageProcessor.cpp.

bool ImageProcessor::Laplace2 ( const CByteImage pInputImage,
CShortImage pOutputImage,
bool  bAbsoluteValue = true 
)

Filters a CByteImage with the Laplace2 operator and writes the result to a CShortImage.

The Laplace2 operator is an omnidirectional high pass filter (edge filter). It is an approximation of a second order derivative. The used filter kernel is: $ \left(\begin{array}{ccc} 1 & 1 & 1 \\ 1 & -8 & 1 \\ 1 & 1 & 1 \\ \end{array}\right) $.

The width and height of pInputImage and pOutputImage must match.
pInputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
bAbsoluteValueIf true, the absolute values are written to pOutputImage.

Definition at line 1156 of file ImageProcessor.cpp.

bool ImageProcessor::Laplace2 ( const CByteImage pInputImage,
CByteImage pOutputImage,
bool  bAbsoluteValue = true 
)

Filters a CByteImage with the Laplace2 operator and writes the result to a CByteImage.

This function is a convenience function, creating an instance of CShortImage, calling Laplace2(const CByteImage*, CShortImage*, bool), and then calling ConvertImage(const CShortImage*, CByteImage*). See the documentations of these functions for further information. Note that there is no runtime penalty if pInputImage and pOutputImage share the same memory area, since a temporary instance of CShortImage is used for storing the result of the convolution in any case.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
bAbsoluteValueIf true, the absolute values are written to pOutputImage.

Definition at line 1094 of file ImageProcessor.cpp.

bool ImageProcessor::Max ( const CByteImage pInputImage1,
const CByteImage pInputImage2,
CByteImage pOutputImage 
)

Sets each pixel in a CByteImage to the maximum of the corresponding pixels in two instances of CByteImage.

This function implements the following point operation: pOutputImage->pixels[i] = MY_MAX(pInputImage1->pixels[i], pInputImage2->pixels[i]).

The width, height and type of pInputImage1, pInputImage2 and pOutputImage must match.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

As this is a point operation, there is no copy overhead if pInputImage1, pInputImage2, or pOutputImage share the same memory area.

Parameters:
pInputImage1The first input image.
pInputImage2The second input image.
pOutputImageThe output image.

Definition at line 7245 of file ImageProcessor.cpp.

unsigned char ImageProcessor::MaxValue ( const CByteImage pImage)

Returns the maximum value within a grayscale CByteImage.

Parameters:
pImageThe input image. Must be of type CByteImage::eGrayScale.

Definition at line 7270 of file ImageProcessor.cpp.

short ImageProcessor::MaxValue ( const CShortImage pImage)

Returns the maximum value within a CShortImage.

Parameters:
pImageThe input image.

Definition at line 7297 of file ImageProcessor.cpp.

int ImageProcessor::MaxValue ( const CIntImage pImage)

Returns the maximum value within a CIntImage.

Parameters:
pImageThe input image.

Definition at line 7318 of file ImageProcessor.cpp.

bool ImageProcessor::Min ( const CByteImage pInputImage1,
const CByteImage pInputImage2,
CByteImage pOutputImage 
)

Sets each pixel in a CByteImage to the minimum of the corresponding pixels in two instances of CByteImage.

This function implements the following point operation: pOutputImage->pixels[i] = MY_MIN(pInputImage1->pixels[i], pInputImage2->pixels[i]).

The width, height and type of pInputImage1, pInputImage2 and pOutputImage must match.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

As this is a point operation, there is no copy overhead if pInputImage1, pInputImage2, or pOutputImage share the same memory area.

Parameters:
pInputImage1The first input image.
pInputImage2The second input image.
pOutputImageThe output image.

Definition at line 7221 of file ImageProcessor.cpp.

bool ImageProcessor::MinMaxValue ( const CByteImage pImage,
unsigned char &  min,
unsigned char &  max 
)

Computes the minimum and maximum value within a grayscale CByteImage.

Parameters:
pImageThe input image. Must be of type CByteImage::eGrayScale.
minThe result parameter containing the minimum value after execution.
maxThe result parameter containing the maximum value after execution.

Definition at line 7408 of file ImageProcessor.cpp.

void ImageProcessor::MinMaxValue ( const CShortImage pImage,
short &  min,
short &  max 
)

Computes the minimum and maximum value within a CShortImage.

Parameters:
pImageThe input image.
minThe result parameter containing the minimum value after execution.
maxThe result parameter containing the maximum value after execution.

Definition at line 7437 of file ImageProcessor.cpp.

void ImageProcessor::MinMaxValue ( const CIntImage pImage,
int &  min,
int &  max 
)

Computes the minimum and maximum value within a CIntImage.

Parameters:
pImageThe input image.
minThe result parameter containing the minimum value after execution.
maxThe result parameter containing the maximum value after execution.

Definition at line 7458 of file ImageProcessor.cpp.

unsigned char ImageProcessor::MinValue ( const CByteImage pImage)

Returns the minimum value within a grayscale CByteImage.

Parameters:
pImageThe input image.

Definition at line 7339 of file ImageProcessor.cpp.

short ImageProcessor::MinValue ( const CShortImage pImage)

Returns the minimum value within a CShortImage.

Parameters:
pImageThe input image.

Definition at line 7366 of file ImageProcessor.cpp.

int ImageProcessor::MinValue ( const CIntImage pImage)

Returns the minimum value within a CIntImage.

Parameters:
pImageThe input image.

Definition at line 7387 of file ImageProcessor.cpp.

bool ImageProcessor::NormalizeColor ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Applies histogram equalization to all channels of a color CByteImage.

Applies histogram equalization to all three channels of a color image independently.

The width, height and type of pInputImage and pOutputImage must match.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

As this is a point operation, there is no copy overhead if pInputImage and pOutputImage share the same memory area.

Parameters:
pInputImageThe input image. Must be a color image of type CByteImage::eRGB24 or CByteImage::eRGB24Split.
pOutputImageThe output image. Must be of the same type as pInputImage.

Definition at line 5418 of file ImageProcessor.cpp.

bool ImageProcessor::Or ( const CByteImage pInputImage1,
const CByteImage pInputImage2,
CByteImage pOutputImage 
)

Applies the bitwise operator OR to two instance of CByteImage and writes the result to a CByteImage.

This function implements the following point operation: pOutputImage->pixels[i] = pInputImage1->pixels[i] | pInputImage2->pixels[i].

The width, height and type of pInputImage1, pInputImage2 and pOutputImage must match.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

As this is a point operation, there is no copy overhead if pInputImage1, pInputImage2, or pOutputImage share the same memory area.

Parameters:
pInputImage1The first input image.
pInputImage2The second input image.
pOutputImageThe output image.

Definition at line 7053 of file ImageProcessor.cpp.

unsigned int ImageProcessor::PixelSum ( const CByteImage pImage)

Returns the sum of all pixel values of a grayscale CByteImage.

Parameters:
pImageThe input image. Must be of type CByteImage::eGrayScale.

Definition at line 7480 of file ImageProcessor.cpp.

bool ImageProcessor::PrewittX ( const CByteImage pInputImage,
CShortImage pOutputImage,
bool  bAbsoluteValue = true 
)

Filters a CByteImage with the PrewittX operator and writes the result to a CShortImage.

The PrewittX operator computes gradients in x-direction and is thus suitable for the detection of vertical edges. The used filter kernel is: $ \left(\begin{array}{ccc} -1 & 0 & 1\\ -1 & 0 & 1\\ -1 & 0 & 1\\ \end{array}\right) $.

The width and height of pInputImage and pOutputImage must match.
pInputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
bAbsoluteValueIf true, the absolute values are written to pOutputImage, i.e. edge direction information is lost.

Definition at line 1031 of file ImageProcessor.cpp.

bool ImageProcessor::PrewittX ( const CByteImage pInputImage,
CByteImage pOutputImage,
bool  bAbsoluteValue = true 
)

Filters a CByteImage with the PrewittX operator and writes the result to a CByteImage.

This function is a convenience function, creating an instance of CShortImage, calling PrewittX(const CByteImage*, CShortImage*, bool), and then calling ConvertImage(const CShortImage*, CByteImage*). See the documentations of these functions for further information. Note that there is no runtime penalty if pInputImage and pOutputImage share the same memory area, since a temporary instance of CShortImage is used for storing the result of the convolution in any case.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
bAbsoluteValueIf true, the absolute values are written to pOutputImage, i.e. edge direction information is lost.

Definition at line 963 of file ImageProcessor.cpp.

bool ImageProcessor::PrewittY ( const CByteImage pInputImage,
CShortImage pOutputImage,
bool  bAbsoluteValue = true 
)

Filters a CByteImage with the PrewittY operator and writes the result to a CShortImage.

The PrewittY operator computes gradients in y-direction and is thus suitable for the detection of horizontal edges. The used filter kernel is: $ \left(\begin{array}{ccc} -1 & -1 & -1\\ 0 & 0 & 0\\ 1 & 1 & 1\\ \end{array}\right) $.

The width and height of pInputImage and pOutputImage must match.
pInputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
bAbsoluteValueIf true, the absolute values are written to pOutputImage, i.e. edge direction information is lost.

Definition at line 983 of file ImageProcessor.cpp.

bool ImageProcessor::PrewittY ( const CByteImage pInputImage,
CByteImage pOutputImage,
bool  bAbsoluteValue = true 
)

Filters a CByteImage with the PrewittY operator and writes the result to a CByteImage.

This function is a convenience function, creating an instance of CShortImage, calling PrewittY(const CByteImage*, CShortImage*, bool), and then calling ConvertImage(const CShortImage*, CByteImage*). See the documentations of these functions for further information. Note that there is no runtime penalty if pInputImage and pOutputImage share the same memory area, since a temporary instance of CShortImage is used for storing the result of the convolution in any case.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
bAbsoluteValueIf true, the absolute values are written to pOutputImage, i.e. edge direction information is lost.

Definition at line 973 of file ImageProcessor.cpp.

int ImageProcessor::RegionGrowing ( const CByteImage pInputImage,
MyRegion resultRegion,
int  x,
int  y,
int  nMinimumPointsPerRegion = 0,
int  nMaximumPointsPerRegion = 0,
bool  bCalculateBoundingBox = true,
bool  bStorePixels = false 
)

Performs a region growing on a binary CByteImage on the basis of one seed point and stores the computed region in a MyRegion.

The region growing algorithm segments the set of connected foreground pixels (4-connectivity) around a given seed point.

The input image is assumed to encode background with the value 0 and foreground with the value 255.

Parameters:
pInputImageThe input image. Must be a binary image of type CByteImage::eGrayScale.
resultRegionThe region entry, in which the information about the region to be detected will be stored.
xThe x-coordinate of the seed point. Must lie within the bounds of pInputImage, i.e. >= 0 and < pInputImage->width.
yThe y-coordinate of the seed point. Must lie within the bounds of pInputImage, i.e. >= 0 and < pInputImage->height.
nMinimumPointsPerRegionSpecifies the minimum number of pixels the region must contain. If the region contains less pixels, the function returns 0. The default value nMinimumPointsPerRegion = 0 means that no lower bound is checked.
nMaximumPointsPerRegionSpecifies the maximum number of pixels the region may contain. If the region contains more pixels, the function returns 0. The default value nMaximumPointsPerRegion = 0 means that no upper bound is checked.
bCalculateBoundingBoxCalculate bounding box (members min_x, min_y, max_x, max_y, ratio of MyRegion) or not. Setting bCalculateBoundingBox to false saves computation time.
bStorePixelsStore pixels belonging to the region in the member MyRegion::pPixels. Memory is handled automatically (allocation/deletion). Setting bStorePixels to false saves computation time.
Returns:
the number of pixels in resultRegion. If an error occurs, -1 is returned. If the segmented region does not fulfill the size constraints, 0 is returned. After a successful call, the return value is at least 1 (for the seed point).

Definition at line 4389 of file ImageProcessor.cpp.

bool ImageProcessor::Resize ( const CByteImage pInputImage,
CByteImage pOutputImage,
const MyRegion pROI = 0,
bool  bInterpolation = true 
)

Resizes a CByteImage and writes the result to a CByteImage.

The image stored in pInputImage is resized to the dimensions specified by pOutputImage. The result is written to pOutputImage.

pInputImage and pOutputImage must be either both of type CByteImage::eGrayScale or both of type CByteImage::eRGB24.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
pROIDescribes the area within pInputImage containing the pixels which shall be resized. If pROI is 0, then the whole image contained in pInputImage is resized.
bInterpolationDetermines whether bilinear interpolation is used or not.

Definition at line 3422 of file ImageProcessor.cpp.

bool ImageProcessor::Rotate ( const CByteImage pInputImage,
CByteImage pOutputImage,
float  mx,
float  my,
float  theta,
bool  bInterpolation = true 
)

Rotates pInputImage to the dimensions specified by pOutputImage and stores the result in pOutputImage.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be either both of type CByteImage::eGrayScale or both of type CByteImage::eRGB24.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
mxThe x-coordinate of the rotation center.
myThe y-coordinate of the rotation center.
thetaThe rotation angle, given in radians.
bInterpolationDetermines whether bilinear interpolation is used or not.

Definition at line 3815 of file ImageProcessor.cpp.

bool ImageProcessor::Rotate180Degrees ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Rotates a CByteImage by 180 degrees and writes the result to a CByteImage.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be either both of type CByteImage::eGrayScale or both of type CByteImage::eRGB24.

If pInputImage and pOutputImage share the same memory area, the input image is copied to a temporary image first.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 4240 of file ImageProcessor.cpp.

bool ImageProcessor::SobelX ( const CByteImage pInputImage,
CShortImage pOutputImage,
bool  bAbsoluteValue = true 
)

Filters a CByteImage with the SobelX operator and writes the result to a CShortImage.

The SobelX operator computes gradients in x-direction and is thus suitable for the detection of vertical edges. The used filter kernel is: $ \left(\begin{array}{ccc} -1 & 0 & 1\\ -2 & 0 & 2\\ -1 & 0 & 1\\ \end{array}\right) $.

The width and height of pInputImage and pOutputImage must match.
pInputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
bAbsoluteValueIf true, the absolute values are written to pOutputImage, i.e. edge direction information is lost.

Definition at line 914 of file ImageProcessor.cpp.

bool ImageProcessor::SobelX ( const CByteImage pInputImage,
CByteImage pOutputImage,
bool  bAbsoluteValue = true 
)

Filters a CByteImage with the SobelX operator and writes the result to a CByteImage.

This function is a convenience function, creating an instance of CShortImage, calling SobelX(const CByteImage*, CShortImage*, bool), and then calling ConvertImage(const CShortImage*, CByteImage*). See the documentations of these functions for further information. Note that there is no runtime penalty if pInputImage and pOutputImage share the same memory area, since a temporary instance of CShortImage is used for storing the result of the convolution in any case.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
bAbsoluteValueIf true, the absolute values are written to pOutputImage, i.e. edge direction information is lost.

Definition at line 846 of file ImageProcessor.cpp.

bool ImageProcessor::SobelY ( const CByteImage pInputImage,
CShortImage pOutputImage,
bool  bAbsoluteValue = true 
)

Filters a CByteImage with the SobelY operator and writes the result to a CShortImage.

The SobelY operator computes gradients in y-direction and is thus suitable for the detection of horizontal edges. The used filter kernel is: $ \left(\begin{array}{ccc} -1 & -2 & -1\\ 0 & 0 & 0\\ 1 & 2 & 1\\ \end{array}\right) $.

The width and height of pInputImage and pOutputImage must match.
pInputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
bAbsoluteValueIf true, the absolute values are written to pOutputImage, i.e. edge direction information is lost.

Definition at line 866 of file ImageProcessor.cpp.

bool ImageProcessor::SobelY ( const CByteImage pInputImage,
CByteImage pOutputImage,
bool  bAbsoluteValue = true 
)

Filters a CByteImage with the SobelY operator and writes the result to a CByteImage.

This function is a convenience function, creating an instance of CShortImage, calling SobelY(const CByteImage*, CShortImage*, bool), and then calling ConvertImage(const CShortImage*, CByteImage*). See the documentations of these functions for further information. Note that there is no runtime penalty if pInputImage and pOutputImage share the same memory area, since a temporary instance of CShortImage is used for storing the result of the convolution in any case.

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be of type CByteImage::eGrayScale.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
bAbsoluteValueIf true, the absolute values are written to pOutputImage, i.e. edge direction information is lost.

Definition at line 856 of file ImageProcessor.cpp.

bool ImageProcessor::Spread ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

Performs a spread operation on pInputImage and stores the result in pOutputImage.

Linearly maps the interval [min, max] to [0, 255], where min/max are the minimum/maximum value in pInputImage.
If pInputImage is homogeneous, the values of pOutputImage are all set to zero.

The width and height of pInputImage and pOutputImage must match.
Both images must be of type CByteImage::eGrayScale.

As this is a point operation, there is no copy overhead if pInputImage and pOutputImage share the same memory area.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.

Definition at line 2021 of file ImageProcessor.cpp.

bool ImageProcessor::Subtract ( const CByteImage pInputImage1,
const CByteImage pInputImage2,
CByteImage pOutputImage 
)

Sets each pixel in a CByteImage to the difference between the corresponding pixels in two instances of CByteImage.

This function implements the following point operation: pOutputImage->pixels[i] = pInputImage1->pixels[i] - pInputImage2->pixels[i].

No saturation is performed, i.e. overflows are not handled. For instance, 200 - 201 results in 255, 200 - 202 results in 254, and so on.

The width, height and type of pInputImage1, pInputImage2 and pOutputImage must match.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

As this is a point operation, there is no copy overhead if pInputImage1, pInputImage2, or pOutputImage share the same memory area.

Parameters:
pInputImage1The first input image.
pInputImage2The second input image.
pOutputImageThe output image.

Definition at line 7125 of file ImageProcessor.cpp.

bool ImageProcessor::SubtractWithSaturation ( const CByteImage pInputImage1,
const CByteImage pInputImage2,
CByteImage pOutputImage 
)

Sets each pixel in a CByteImage to the difference between the corresponding pixels in two instances of CByteImage, handling overflows with saturation.

This function implements the following point operation: pOutputImage->pixels[i] = MY_MAX((int) pInputImage1->pixels[i] + (int) pInputImage2->pixels[i], 0).

Saturation is performed, i.e. overflows are handled with truncation. For instance, 200 - 201 results in 0, 200 - 202 results in 0, and so on.

The width, height and type of pInputImage1, pInputImage2 and pOutputImage must match.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

As this is a point operation, there is no copy overhead if pInputImage1, pInputImage2, or pOutputImage share the same memory area.

Parameters:
pInputImage1The first input image.
pInputImage2The second input image.
pOutputImageThe output image.

Definition at line 7149 of file ImageProcessor.cpp.

bool ImageProcessor::ThresholdBinarize ( const CByteImage pInputImage,
CByteImage pOutputImage,
unsigned char  nThreshold 
)

Performs threshold binarization to a CByteImage and writes the result to a CByteImage.

Sets each pixel in pOutputImage to 255 if the corresponding pixel in pInputImage has a value greater than or equal to nThreshold and to 0 otherwise.

The width and height of pInputImage and pOutputImage must match. pInputImage and pOutputImage must be both of type CByteImage::eGrayScale.

As this is a point operation, there is no copy overhead if pInputImage and pOutputImage share the same memory area.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
nThresholdThe threshold value.

Definition at line 3901 of file ImageProcessor.cpp.

bool ImageProcessor::ThresholdBinarize ( const CByteImage pInputImage,
CByteImage pOutputImage,
unsigned char  nMinThreshold,
unsigned char  nMaxThreshold 
)

Performs threshold binarization to a CByteImage and writes the result to a CByteImage.

Sets each pixel in pOutputImage to 255 if the corresponding pixel in pInputImage has a value greater than or equal to nMinThreshold and smaller than or equal nMaxThreshold, and to 0 otherwise.

The width and height of pInputImage and pOutputImage must match. pInputImage and pOutputImage must be both of type CByteImage::eGrayScale.

As this is a point operation, there is no copy overhead if pInputImage and pOutputImage share the same memory area.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
nThresholdThe threshold value.

Definition at line 3924 of file ImageProcessor.cpp.

bool ImageProcessor::ThresholdBinarize ( const CFloatMatrix pInputImage,
CFloatMatrix pOutputImage,
float  fThreshold 
)

Performs threshold binarization to a CFloatMatrix and writes the result to a CFloatMatrix.

Sets each pixel in pOutputImage to 255.0f if the corresponding pixel in pInputImage has a value greater than or equal to fThreshold and to 0.0f otherwise.

The number of columns and rows of pInputImage and pOutputImage must match.

As this is a point operation, there is no copy overhead if pInputImage and pOutputImage share the same memory area.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
fThresholdThe threshold value.

Definition at line 3947 of file ImageProcessor.cpp.

bool ImageProcessor::ThresholdBinarizeInverse ( const CByteImage pInputImage,
CByteImage pOutputImage,
unsigned char  nThreshold 
)

Performs inverse threshold binarization to a CByteImage and writes the result to a CByteImage.

Sets each pixel in pOutputImage to 255 if the corresponding pixel in pInputImage has a value less than or equal to nThreshold and to 0 otherwise.

The width and height of pInputImage and pOutputImage must match. pInputImage and pOutputImage must be both of type CByteImage::eGrayScale.

As this is a point operation, there is no copy overhead if pInputImage and pOutputImage share the same memory area.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
nThresholdThe threshold value.

Definition at line 3965 of file ImageProcessor.cpp.

bool ImageProcessor::ThresholdFilter ( const CByteImage pInputImage,
CByteImage pOutputImage,
unsigned char  nThreshold 
)

Performs threhold filtering to a CByteImage and writes the result to a CByteImage.

Copies each pixel in pOutputImage if the corresponding pixel in pInputImage has a value greater than or equal to nThreshold and sets it to 0 otherwise.

The width and height of pInputImage and pOutputImage must match. pInputImage and pOutputImage must be both of type CByteImage::eGrayScale.

As this is a point operation, there is no copy overhead if pInputImage and pOutputImage share the same memory area.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
nThresholdThe threshold value.

Definition at line 3988 of file ImageProcessor.cpp.

bool ImageProcessor::ThresholdFilterInverse ( const CByteImage pInputImage,
CByteImage pOutputImage,
unsigned char  nThreshold 
)

Performs inverse threhold filtering to a CByteImage and writes the result to a CByteImage.

Copies each pixel in pOutputImage if the corresponding pixel in pInputImage has a value less than or equal to nThreshold and sets it to 0 otherwise.

The width and height of pInputImage and pOutputImage must match. pInputImage and pOutputImage must be both of type CByteImage::eGrayScale.

As this is a point operation, there is no copy overhead if pInputImage and pOutputImage share the same memory area.

Parameters:
pInputImageThe input image.
pOutputImageThe output image.
nThresholdThe threshold value.

Definition at line 4011 of file ImageProcessor.cpp.

bool ImageProcessor::Xor ( const CByteImage pInputImage1,
const CByteImage pInputImage2,
CByteImage pOutputImage 
)

Applies the bitwise operator XOR to two instance of CByteImage and writes the result to a CByteImage.

This function implements the following point operation: pOutputImage->pixels[i] = pInputImage1->pixels[i] ^ pInputImage2->pixels[i].

The width, height and type of pInputImage1, pInputImage2 and pOutputImage must match.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).

As this is a point operation, there is no copy overhead if pInputImage1, pInputImage2, or pOutputImage share the same memory area.

Parameters:
pInputImage1The first input image.
pInputImage2The second input image.
pOutputImageThe output image.

Definition at line 7030 of file ImageProcessor.cpp.

void ImageProcessor::Zero ( CByteImage pImage,
const MyRegion pROI = 0 
)

Sets all values in a CByteImage to zero.

Parameters:
pImageThe image.
pROIThe region which contains the values which shall be set to zero. If pROI is 0, then all pixels of pImage are set to zero.

Definition at line 2939 of file ImageProcessor.cpp.

Sets all values in a CShortImage to zero.

Parameters:
pImageThe image.

Definition at line 2999 of file ImageProcessor.cpp.

Sets all values in a CIntImage to zero.

Parameters:
pImageThe image.

Definition at line 3004 of file ImageProcessor.cpp.

Sets all values in a CFloatMatrix to zero.

Parameters:
pImageThe image.

Definition at line 3009 of file ImageProcessor.cpp.

Sets all values in a CDoubleMatrix to zero.

Parameters:
pImageThe image.

Definition at line 3014 of file ImageProcessor.cpp.

Sets all pixels on a one pixel wide frame of a CByteImage to zero.

The frame consists of the top and bottom row as well as the leftmost and rightmost column.

Parameters:
pImageThe target image.

Definition at line 3020 of file ImageProcessor.cpp.

Sets all pixels on a one pixel wide frame of a CShortImage to zero.

The frame consists of the top and bottom row as well as the leftmost and rightmost column.

Parameters:
pImageThe target image.

Definition at line 3056 of file ImageProcessor.cpp.

Sets all pixels on a one pixel wide frame of a CIntImage to zero.

The frame consists of the top and bottom row as well as the leftmost and rightmost column.

Parameters:
pImageThe target image.

Definition at line 3074 of file ImageProcessor.cpp.



asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Thu Jun 6 2019 21:46:59