camellia.h File Reference

Camellia Image Processing Library header file. More...

Go to the source code of this file.

Data Structures

struct  CamROI
 The IPL Region Of Interest structure. More...
struct  CamPoint
 The structure used to identify a point in 2D. More...
struct  CamImage
 The famous IplImage/CamImage structure, today's standard structure for image processing. More...
struct  CamArithmParams
 This is the parameter structure for the arithmetic computation kernel. More...
struct  CamTable
 Pixel table (LUT (Look-Up Table) and histogram) structure. More...
struct  CamMorphoMathsKernel
 This is the parameter structure for the morpho maths kernel. More...
struct  CamLabelingResults
 Data structure containing the result of pixel-based labeling. More...
struct  CamRun
 The CamRun structure, basic element of a Run-Length Encoding (RLE) of an image. More...
struct  CamBlobInfo
 The Blob (block of bits) Information Structure. This is the most important result of Labeling + Blob analysis. More...
struct  CamBlobs
 The result of any blob analysis. Essentially an array of CamBlobInfo. More...
struct  CamRLEImage
 The CamRLEImage structure : the RLE (Run Length Encoded) image structure. More...
struct  CamMeasuresResults
 The structure containing the result of measuring. More...
struct  CamVolbergFwdParams
 The structure to provide to the Volberg's algorithm : two functions. More...
struct  CamWarpingParams
 The parameters structure used by camWarping(). More...
struct  CamLinearFilterKernel
 The parameters structure for linear filtering. More...
struct  CamSepFilterKernel
 The parameters structure for linear filtering. More...
struct  CamBasin
 The structure defining a basin. More...
struct  CamTableOfBasins
 The table of basins structure. Simply a dynamic size array of CamBasin. More...
struct  CamKeypoint
 The Keypoint structure. More...
struct  CamAffineTransform
 Affine Transform parameters. More...
struct  CamKeypointsMatches
 A match between 2 CamKeypoints. More...
struct  CamKeypoints
 The CamKeypoints structure. More...
struct  CamKeypointsKdTree
 The CamKeypointsKdTree class. More...
struct  CamBitmapFont
 The bitmap font structure. More...

Histogram computation

#define CAM_EQUAL_PERFECT   0
#define CAM_EQUAL_FAST   1
int camHistogram (CamImage *image, CamTable *histo)
 The classical image histogramming.
int camHistogramEqualization (CamImage *src, CamImage *dest, CamTable *src_histo, int option, CamImage *work)
 Histogram Equalization.
int camHistogram2Channels (CamImage *image, int ch1, int ch2, CamImage *result, int size)
 Two channels histogram computation.
int camFindThreshold (CamTable *histo, int percent)
 Compute the threshold for a given percentage of pixels.

Warping functions

#define CAM_NN_INTERPOLATION   0
#define CAM_BILINEAR_INTERPOLATION   1
void camVolbergFwdScanline (CAM_PIXEL *in, int inlen, CAM_PIXEL *out, int outlen, double f[])
 Warping using Volberg's algorithm.
void camVolbergFwd (CamImage *source, CamImage *dest, CamVolbergFwdParams *params)
 Helper function for using Volberg's warping algorithm.
int camWarping (CamImage *source, CamImage *dest, CamWarpingParams *params)
 Backward warping function.
int camScale (CamImage *source, CamImage *dest)
 Scaling function.
int camWarpingSuperSampling (CamImage *source, CamImage *dest, CamWarpingParams *params)
int camIntersectionSegments (CamPoint p[4], CamPoint *res)
 Simple helper function, used by camWarping().

Linear filtering kernel

#define CamSobel3x3   camSobel
#define CamSobelAbs3x3   camSobelAbs
#define CAM_LINEAR_FILTER_KERNEL_MAX_SIZE   7
#define CAM_SOBEL_H   1
#define CAM_SOBEL_V   2
#define CAM_GAUSSIAN_3x3   3
#define CAM_GAUSSIAN_5x5   4
#define CAM_GAUSSIAN_7x7   5
#define CAM_SCHARR_H   6
#define CAM_SCHARR_V   7
int camLinearFilter3x3 (CamImage *source, CamImage *dest, CamLinearFilterKernel *params)
 3x3 Linear Filtering function
int camLinearFilter5x5 (CamImage *source, CamImage *dest, CamLinearFilterKernel *params)
 5x5 Linear Filtering function
int camLinearFilterAbs3x3 (CamImage *source, CamImage *dest, CamLinearFilterKernel *params)
 3x3 Linear Filtering function (absolute)
int camLinearFilterAbs5x5 (CamImage *source, CamImage *dest, CamLinearFilterKernel *params)
 5x5 Linear Filtering function (absolute)
int camSepFilter3x3 (CamImage *source, CamImage *dest, CamSepFilterKernel *kernel)
 3x3 Linear Filtering function with a separable kernel
int camSepFilterAbs3x3 (CamImage *source, CamImage *dest, CamSepFilterKernel *kernel)
 3x3 Linear Filtering function with a separable kernel (absolute value)
int camSepFilter5x5 (CamImage *source, CamImage *dest, CamSepFilterKernel *kernel)
 5x5 Linear Filtering function with a separable kernel
int camSepFilterAbs5x5 (CamImage *source, CamImage *dest, CamSepFilterKernel *kernel)
 5x5 Linear Filtering function with a separable kernel (absolute value)
int camSepFilter7x7 (CamImage *source, CamImage *dest, CamSepFilterKernel *kernel)
 7x7 Linear Filtering function with a separable kernel
int camSepFilterAbs7x7 (CamImage *source, CamImage *dest, CamSepFilterKernel *kernel)
 7x7 Linear Filtering function with a separable kernel (absolute value)
int camSobelH (CamImage *source, CamImage *dest)
 3x3 Horizontal Sobel Filter. Detects horizontal edges.
int camSobelHAbs (CamImage *source, CamImage *dest)
 3x3 Horizontal Sobel Filter (absolute). Detects horizontal edges.
int camSobelV (CamImage *source, CamImage *dest)
 3x3 Vertical Sobel Filter. Detects Vertical edges.
int camSobelVAbs (CamImage *source, CamImage *dest)
 3x3 Vertical Sobel Filter (absolute). Detects Vertical edges.
int camFixedFilter (CamImage *source, CamImage *dest, int filter)
 Linear convolution with a predefined kernel.
int camScharrH (CamImage *source, CamImage *dest)
int camScharrV (CamImage *source, CamImage *dest)
int camScharrHAbs (CamImage *source, CamImage *dest)
int camScharrVAbs (CamImage *source, CamImage *dest)

Median filtering kernel

#define camMedianFiltering3x3   camMedianFilter3x3
#define camMedianFiltering5x5   camMedianFilter5x5
int camMedianFilter3x3 (CamImage *source, CamImage *dest)
 3x3 Median Filtering function
int camMedianFilter5x5 (CamImage *source, CamImage *dest)
 5x5 Median Filtering function

Watersheding kernel

#define CAM_NOT_COMPUTED   65536
int camWatershed1D (int *input, int size, int *results)
 1D watershed computation
void camFreeTableOfBasins (CamTableOfBasins *t)
 Free a table of basins after use.
int camHierarchicalWatershed (CamImage *source, CamImage *dest, CamTableOfBasins *tob)
 2D Hierarchical watershed computation
int camHierarchicalWatershedContours (CamImage *source, CamImage *dest, CamTableOfBasins *tob)
 2D Hierarchical watershed computation (with watershed/contours markers)
int camHierarchicalWatershedRegions (CamImage *watershed, CamTableOfBasins *tob)
 Retrieves regions from a watershed image.

Keypoints and Local descriptors

#define CAM_MAX_NB_MATCHES   2048
#define CAM_UPRIGHT   1
int camKeypointsSetParameters (int patchSize, int sigma, int threshGradient)
int camAllocateKeypoints (CamKeypoints *fpoints, int nbPoints)
 Keypoints allocation.
int camReallocateKeypoints (CamKeypoints *fpoints, int nbPoints)
 Keypoints reallocation.
int camFreeKeypoints (CamKeypoints *fpoints)
 Keypoints release.
int camDrawKeypoints (CamKeypoints *points, CamImage *dest, int color)
 Draw kepoints on screen.
int camDrawKeypoint (CamKeypoint *point, CamImage *dest, int color)
 Draw one keypoint on screen.
int camHarris (CamImage *source, CamKeypoints *points, int k)
 Harris corner detector.
int camFindLocalMaximaCircle7 (CamImage *source, CamKeypoints *points, int threshold)
 Local maxima finder (Circle7 neighborhood).
int camFindLocalMaximaCircle5 (CamImage *source, CamKeypoints *points, int threshold)
 Local maxima finder (Circle5 neighborhood).
int camFindLocalMaximaCircle3 (CamImage *source, CamKeypoints *points, int threshold)
 Local maxima finder (Square3 neighborhood).
int camIntegralImage (CamImage *src, CamImage *dest)
 Integral image computation.
int camFastHessianDetectorFixedScale (CamImage *integral, CamImage *dest, int scale)
 Fast Hessian Detection (for one scale only).
int camFastHessianDetector (CamImage *source, CamKeypoints *points, int threshold, int options)
 Fast Hessian Detection (for all scales).
CamKeypointcamFindKeypoint (CamKeypoint *point, CamKeypoints *points, int *dist1, int *dist2)
 Find a keypoint in a set of keypoints.
int camAllocateKeypointsMatches (CamKeypointsMatches *matches, int nbpairs)
 Allocate keypoints matches.
void camFreeKeypointsMatches (CamKeypointsMatches *matches)
 Free keypoints matches.
int camKeypointsMatching (CamKeypoints *target, CamKeypoints **models, int nbModels, CamKeypointsMatches *matches)
 Find an object in a database (brute force matching).
int camKeypointsMatching2 (CamKeypoints *points1, CamKeypoints *points2, CamKeypointsMatches *matches)
int camFindAffineTransform (CamKeypointsMatches *matches, CamAffineTransform *t, int *error)
 Find the affine transform from one object to the next.
int camFindAffineTransform2 (CamKeypointsMatches *matches, CamAffineTransform *t, int *error)
void camApplyAffineTransform (CamPoint *xy, CamPoint *uv, CamAffineTransform *t)
 Apply an affine transform on a point (xy) to find the target point (uv).
int camKeypointsMatchingKdTree (CamKeypoints *target, CamFPKdTreeNode *kdTreeRoot, CamKeypointsMatches *matches, int explore)
CamFPKdTreeNode * camKeypointsCompileKdTree (CamKeypoints **models, int nbModels)
CamKeypointcamFindKeypointKdTree (CamKeypoint *point, CamFPKdTreeNode *kdTreeRoot, int explore, int *dist1, int *dist2)

Utility functions

#define camDownScaling2x2   camDownscaling2x2
#define CAM_CONFIG_MAX_ENTRIES   256
#define CAM_CAPTURE_AUTO_SOURCE   1
#define CAM_CAPTURE_DISPLAY   2
#define CAM_CAPTURE_USE_READ   4
typedef void(* camErrorFunct )(char *, char *)
int camAllocateImage (CamImage *image, int width, int height, int depth)
 Grey scale image allocation.
int camAllocateImageEx (CamImage *image, int width, int height, int depth, int color_seq)
 Any kind of image allocation.
int camFillImageHeader (CamImage *image, int width, int height, int depth, int channelseq)
 Fill image header (no memory initialization).
int camAllocateYUVImage (CamImage *image, int width, int height)
 YUV image allocation.
int camAllocateHLSImage (CamImage *image, int width, int height)
 HLS image allocation.
int camAllocateRGBImage (CamImage *image, int width, int height)
 RGB image allocation.
int camAllocateRGBAImage (CamImage *image, int width, int height)
 RGB image allocation with alpha channel.
int camAllocateBGRImage (CamImage *image, int width, int height)
 BGR image allocation.
int camAllocateBGRAImage (CamImage *image, int width, int height)
 BGR image allocation with alpha channel.
int camDeallocateImage (CamImage *image)
 Image memory release.
int camFreeImage (CamImage *image)
 Image memory release.
int camSetROI (CamROI *roi, int coi, int xOffset, int yOffset, int width, int height)
 Set the ROI utility function.
int camSetMaxROI (CamROI *roi, CamImage *image)
 Set the ROI to the maximum size of the image.
int camReduceROI (CamROI *roi, int pixels)
 Reduce the roi by a given number of pixels on each side.
int camEnlargeROI (CamROI *roi, int pixels)
 Enlarge the roi by a given number of pixels on each side.
int camZoom2x (CamImage *src, CamImage *dst)
 Simple 2x Zoom functin (by pixels replication).
int camDecimateNN (CamImage *src, CamImage *dest, int factor)
 Simple nearest-neighbour decimation.
int camSetRLEMask (CamImage *image, CamRLEImage *mask)
 Set the image mask (Run-Length encoded mask).
int camSetMask (CamImage *image, CamImage *mask)
 Set the image mask (CamImage mask).
int camDownScaling2x2 (CamImage *src, CamImage *dest)
 2x2 linear interpolation downscaling
int camCopy (CamImage *source, CamImage *dest)
 Copy function, without any color space conversion, but able to deal with planar/pixel oriented conversion, ROIs and even masking.
int camClone (CamImage *source, CamImage *dest)
 Simple cloning function.
int camRefCopy (CamImage *source, CamImage *dest)
 Reference copy.
int camSet (CamImage *image, int fillValue)
 Set all the pixel values to fillValue.
int camAlphaComposite (CamImage *source1, CamImage *source2, CamImage *dest)
 Alpha channel compositing.
int camSetBorder (CamImage *image, int borderValue)
 Set the border value of an image.
int camClipROI (CamImage *image)
 Clip the roi of an image.
int camClip (CamROI *roi, CamImage *image)
 Clip a ROI with respect to an image.
int camROIIntersect (CamROI *roi1, CamROI *roi2, CamROI *dest)
 Compute intersection between ROIs.
int camSetImageViewer (char *s)
int camView (CamImage *image)
 View an image.
const char * camVersion ()
 Returns the version of the library.
int camDrawLine (CamImage *image, int x1, int y1, int x2, int y2, int color)
 Draw a line.
int camAccumulateLine (CamImage *image, int x1, int y1, int x2, int y2, int acc)
 Accumulate a line in a frame (very useful for Hough transforms).
int camDrawRectangle (CamImage *image, int x1, int y1, int x2, int y2, int color)
 Draw a rectangle.
int camDrawText16s (CamImage *image, char *text, int x, int y, int cwidth, int cheight, int orientation, int color)
 Draw some text using 16 segments font (looks like an alarm clock...).
int camDrawCircle (CamImage *image, int x, int y, int r, int color)
 Draw a circle.
int camDrawEllipse (CamImage *image, int x, int y, int rx, int ry, int color)
 Draw an ellipse.
int camPlot (CamImage *image, int x, int y, int color, int kind)
 Plot.
int camFillColor (CamImage *image, int x, int y, int fillcolor, int tolerance)
 Fill a region with a color.
int camLoadBitmapFont (CamBitmapFont *font, char *filename)
 Load a bitmap font.
int camFreeBitmapFont (CamBitmapFont *font)
 Deallocate a bitmap font.
int camDrawTextBitmap (CamImage *image, char *text, int x, int y, CamBitmapFont *font)
 Draw some text using a bitmap font.
int camRGB (int r, int g, int b)
 24 bits integer color representation. Stricly equivalent to the Windows RGB macro.
int camRGBA (int r, int g, int b, int a)
 32 bits integer color representation, including an alpha channel
int camLoadPGM (CamImage *image, char *fn)
 Load a PGM image.
int camSavePGM (CamImage *image, char *filename)
 Save a PGM image.
int camSaveRawPGM (CamImage *image, char *filename)
 Save a raw PGM image (8-bits only).
int camLoadBMP (CamImage *image, char *fn)
 Load a BMP image.
int camSaveBMP (CamImage *image, char *filename)
 Save a BMP image.
int camLoadConfig (const char *filename, CamConfig *config)
int camConfigInt (const CamConfig *config, const char *entry)
float camConfigFloat (const CamConfig *config, const char *entry)
const char * camConfigString (const CamConfig *config, const char *entry)
void * camCaptureInit (int options)
int camCapture (void *handle, CamImage *image)
int camCaptureOver (void *handle)
void camError (char *module, char *error)
 Error management function.
void camSetErrorFunct (camErrorFunct funct)

Defines

#define CAM_RGBA(r, g, b, a)   ((r)|((g)<<8)|((b)<<16)|((a)<<24))
 32 bits integer color representation, including an alpha channel.
#define CAM_RGB(r, g, b)   ((r)|((g)<<8)|((b)<<16))
 24 bits integer color representation. Stricly equivalent to the Windows RGB macro. Please use this one in place of RGB for better portability of the code.

Functions

int camMonadicArithm (CamImage *source, CamImage *dest, CamArithmParams *params)
 This is the function that implements all the monadic arithmetic operators (i.e. operators with only one operand).
int camDyadicArithm (CamImage *source1, CamImage *source2, CamImage *dest, CamArithmParams *params)
 This is the function that implements all the dyadic arithmetic operators (i.e. operators with two operands).
int camAdd (CamImage *source1, CamImage *source2, CamImage *dest)
 Image addition.
int camMul (CamImage *source1, CamImage *source2, CamImage *dest)
 Image multiplication.
int camSub (CamImage *source1, CamImage *source2, CamImage *dest)
 Image subtraction.
int camThreshold (CamImage *source, CamImage *dest, int threshold)
 Simple threshold function (wrapper for camMonadicArithm() function).
int camThresholdInv (CamImage *source, CamImage *dest, int threshold)
 Simple threshold function (wrapper for camMonadicArithm() function).
int camAbs (CamImage *source, CamImage *dest)
 Compute absolute value of image (for signed images) (wrapper for camMonadicArithm() function).
int camApplyLUT (CamImage *source, CamImage *dest, CamTable *LUT)
 Apply a Look-Up-Table on image function.
int camLabeling (CamImage *source, CamImage *dest, CamLabelingResults *results)
 4-connectedness labeling function
int camLabeling2ndScan (CamImage *image, CamLabelingResults *results)
 Second scan for pixel-based labeling. Obsolete.
int camBlobAnalysis1stScan (CamImage *blobImage, CamImage *original, CamLabelingResults *info, CamBlobs *results)
 Blob analysis function.
int camBlobAnalysisRefinement (CamImage *blobImage, CamImage *original, CamBlobs *results)
 Second pass, to get some more information if needed.
int camSumHV (CamImage *image, CamTable *hsum, CamTable *vsum)
 Horizontal and vertical summing function.
int camSumV (CamImage *image, CamTable *results)
 Vertical summing function.
int camSumH (CamImage *image, CamTable *results)
 Horizontal summing function.
int camSumOfPixels (CamImage *image)
 Sum of pixels in an image.
int camMeasures (CamImage *image, CamMeasuresResults *results)
 Measures in an image : min, max, average and sum.
float camMeasureAverageDeviation (CamImage *image, int average)
 Average deviation computation.
Morphomaths LLAs
These functions share the same morpho maths kernel

int camMorphoMaths (CamImage *source, CamImage *dest, CamMorphoMathsKernel *kernel)
 This is the function that can compute erosion AND dilation in one scan (with 5x5 neighborhood).
int camErode3x3 (CamImage *source, CamImage *dest, CamMorphoMathsKernel *kernel)
 3x3 neighborhood erosion
int camErode5x5 (CamImage *source, CamImage *dest, CamMorphoMathsKernel *kernel)
 5x5 neighborhood erosion
int camErode7x7 (CamImage *source, CamImage *dest, CamMorphoMathsKernel *kernel)
 7x7 neighborhood erosion
int camDilate3x3 (CamImage *source, CamImage *dest, CamMorphoMathsKernel *kernel)
 3x3 neighborhood dilation
int camDilate5x5 (CamImage *source, CamImage *dest, CamMorphoMathsKernel *kernel)
 5x5 neighborhood dilation
int camDilate7x7 (CamImage *source, CamImage *dest, CamMorphoMathsKernel *kernel)
 7x7 neighborhood dilation
int camMorphoGradientCircle5 (CamImage *source, CamImage *dest)
 Morphological gradient computation (Diameter-5 circle structural element).
int camErodeCircle5 (CamImage *source, CamImage *dest)
 Erosion (Optimized for diameter-5 circle structural element).
int camDilateCircle5 (CamImage *source, CamImage *dest)
 Dilation (Optimized for diameter-5 circle structural element).
int camMorphoGradientCircle7 (CamImage *source, CamImage *dest)
 Morphological gradient computation (Diameter-7 circle structural element).
int camErodeCircle7 (CamImage *source, CamImage *dest)
 Erosion (Optimized for diameter-7 circle structural element).
int camDilateCircle7 (CamImage *source, CamImage *dest)
 Dilation (Optimized for diameter-7 circle structural element).
int camMorphoGradientSquare3 (CamImage *source, CamImage *dest)
 Morphological gradient computation (3x3 square structural element).
int camErodeSquare3 (CamImage *source, CamImage *dest)
 Erosion (3x3 square structural element).
int camDilateSquare3 (CamImage *source, CamImage *dest)
 Dilation (3x3 square structural element).
RLE images processing functions and data structures
int camRLEAllocate (CamRLEImage *rle, int max_runs)
 RLE Image allocation.
int camRLEDeallocate (CamRLEImage *rle)
 RLE image deallocation.
int camRLEFree (CamRLEImage *rle)
 Alias for camRLEDeallocate() function.
int camRLEReallocate (CamRLEImage *rle, int new_max_runs)
 RLE image reallocation.
int camRLEClone (CamRLEImage *source, CamRLEImage *dest)
 RLE image cloning.
int camRLEEncode (CamImage *src, CamRLEImage *dest)
 Run-Length encoding.
int camRLEEncodeLUT (CamImage *src, CamRLEImage *dest, CamTable *LUT)
 Run-Length encoding, with integrated LUT operations.
int camRLEEncodeThreshold (CamImage *src, CamRLEImage *dest, int threshold)
 Run-Length encoding, with integrated thresholding.
int camRLEEncodeThresholdInv (CamImage *src, CamRLEImage *dest, int threshold)
 Run-Length encoding, with integrated thresholding.
int camRLEEncodeColor (CamImage *source, CamRLEImage *dest, CamTable *clusters)
int camRLELabeling (CamRLEImage *src, CamBlobs *results)
 RLE image labeling + blob analysis. 4-connectedness labeling.
int camRLEBlobAnalysis (CamRLEImage *src, CamBlobs *results)
 The RLE Blob Analysis function.
int camRLEApplyLUT (CamRLEImage *src, CamRLEImage *dest, CamTable *LUT)
 The RLE "Apply a LUT" function.
int camRLEDecode (CamRLEImage *src, CamImage *dest, CamTable *LUT)
 The RLE decoding function.
int camRLEDecodeBlobs (CamRLEImage *src, CamImage *dest, CamTable *LUT)
 Another RLE decoding function, used to retrieve some specific blobs.
int camRLEInverse (CamRLEImage *image)
 RLE image inversion.
int camRLEBlobSides (CamBlobInfo *blob, int *left, int *top, int *right, int *bottom)
 RLE blob sides reconstruction.
int camRLEBlobROIIntersect (CamBlobInfo *blob, CamROI *roi)
 RLE blob intersection with a ROI.
int camRLEBlobMeasures (CamBlobInfo *blob, CamImage *original)
 Retrieves the average, min and max values.
int camRLEErodeCross (CamRLEImage *image, CamRLEImage *result)
 RLE image erosion (cross structural element).
int camRLEErode3x3 (CamRLEImage *image, CamRLEImage *result)
 RLE image erosion (3x3 square structural element).
int camRLEErode3x2 (CamRLEImage *image, CamRLEImage *result)
 RLE image erosion (3x2 square structural element).
Hough functions
int camHoughCircle (CamImage *image, int percent, int rmin, int rmax, int *xc, int *yc, int *rc)
 Circle Hough. Find a circle in a picture.
Color conversion functions
int camYUV2RGB (CamImage *source, CamImage *dest)
 Converts a YUV image to a RGB image.
int camRGB2YUV (CamImage *source, CamImage *dest)
 Converts a RGB image to a YUV image.
int camRGB2Y (CamImage *source, CamImage *dest)
 Converts a RGB image to a gray scale image.
int camRGB2HLS (CamImage *source, CamImage *dest)
 Converts a RGB image to a HLS image.
Motion estimation functions
int camSAD8x8 (CamImage *image1, CamImage *image2, int bleft, int btop, int dx, int dy)
int camSAD16x16 (CamImage *image1, CamImage *image2, int bleft, int btop, int dx, int dy)
int camMotionEstimation3DRSInit (CamMotionEstimation3DRSParams *params, int seed, int lsearch, int rsearch, int bs, int scans, int candidates, int test0)
int camMotionEstimation3DRS (CamImage *current, CamImage *previous, CamMotionEstimation3DRSParams *params, CamMotionEstimation3DRSResults *results)
3D Projection/Retroprojection functions
void camProject (const double extr[4][4], const double fc[2], const double cc[2], double x, double y, double z, int *xp, int *yp)
void camBackproject (const double extr[4][4], const double fc[2], const double cc[2], int xp, int yp, double z, double *x, double *y)
int camUndistort (CamImage *source, CamImage *dest, const float *intrinsic_matrix, const float *dist_coeffs)
int camUndistortFixed (CamImage *source, CamImage *dest, const CAM_FIXED_POINT *intrinsic_matrix, const CAM_FIXED_POINT *dist_coeffs)
int camUndistortBuildLUT (CamImage *source, const float *intrinsic_matrix, const float *dist_coeffs, CamImage *LUTX, CamImage *LUTY)
int camUndistortLUT (CamImage *source, CamImage *dest, CamImage *LUTX, CamImage *LUTY)


Detailed Description

Camellia Image Processing Library header file.

Author:
Bruno STEUX (Mines Paris / ParisTech)
Camellia Image Processing Library

The Camellia Image Processing Library is an open source low-level image processing library. As it uses the IplImage structure to describe images, it is a good replacement to the IPL (Intel) library and a good complement to the OpenCV library. It includes a lot of functions for image processing (filtering, morphological mathematics, labeling, warping, loading/saving images, etc.), some of them being highly optimized; It is also cross-platform and robust. It is doxygen-documented and examples of use are provided.

This software library is an outcome of the Camellia european project (IST-2001-34410). It was developped by the Ecole des Mines de Paris (ENSMP), in coordination with the other partners of the project.

==========================================================================

Copyright (c) 2002-2007, Ecole des Mines de Paris - Centre de Robotique All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Ecole des Mines de Paris nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

==========================================================================


Function Documentation

int camAdd ( CamImage source1,
CamImage source2,
CamImage dest 
)

Image addition.

Simple wrapper for camDyadicArithm()

int camAlphaComposite ( CamImage source1,
CamImage source2,
CamImage dest 
)

Alpha channel compositing.

Parameters:
source1 must be a RGB image
source2 must be a RGBA image (with an alpha channel)
dest destination image

int camBlobAnalysis1stScan ( CamImage blobImage,
CamImage original,
CamLabelingResults info,
CamBlobs results 
)

Blob analysis function.

Computes the most important blob information : top, left, width, height, cx, cy, and surface. average, min and max are computed only if a pointer on the original image is provided (slower).

Parameters:
blobImage The result of a previous labeling operation.
original The original CamImage that was labelled previously. Can bet set to NULL.
info The CamLabelingResults structure provided by the former call to camLabeling().(in data)
results The CamBlobs structure that is filled with the collected blob information.
Returns:
0 (false) if an error occurs, especially if the number of blobs is too high.(more than the CAM_LABEL_MAX_BLOBS constant)
In-place processing (blobImage will be affected).

int camBlobAnalysisRefinement ( CamImage blobImage,
CamImage original,
CamBlobs results 
)

Second pass, to get some more information if needed.

Computes the average, min and max blob information, if it was not computed before.

Parameters:
blobImage The result of a previous labeling operation.
original The original CamImage.that was labelled previously.
results The CamBlobs structure that is filled with the collected blob information.
Returns:
0 (false) if an error occurs.

int camClone ( CamImage source,
CamImage dest 
)

Simple cloning function.

This function allocates the memory for the dest image. dest actual content is not considered by this function. Beware not to have allocated an image in dest before, otherwise this will result in a memory leak.

int camCopy ( CamImage source,
CamImage dest 
)

Copy function, without any color space conversion, but able to deal with planar/pixel oriented conversion, ROIs and even masking.

Supports grey scale to color conversion, as well as RGB to RGBA, and RGBA to RGB copying (adding and removing alpha channel)

Returns:
0 (false) if an error occurs

int camDilate3x3 ( CamImage source,
CamImage dest,
CamMorphoMathsKernel kernel 
)

3x3 neighborhood dilation

Parameters:
source The source CamImage to process
dest The destination CamImage
kernel A pointer to a CamMorphoMathsKernel structure, defining the structural element to use. Only the DilationStructElt member is used by this function.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camDilate5x5 ( CamImage source,
CamImage dest,
CamMorphoMathsKernel kernel 
)

5x5 neighborhood dilation

Parameters:
source The source CamImage to process
dest The destination CamImage
kernel A pointer to a CamMorphoMathsKernel structure, defining the structural element to use. Only the DilationStructElt member is used by this function.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camDilate7x7 ( CamImage source,
CamImage dest,
CamMorphoMathsKernel kernel 
)

7x7 neighborhood dilation

Parameters:
source The source CamImage to process
dest The destination CamImage
kernel A pointer to a CamMorphoMathsKernel structure, defining the structural element to use. Only the DilationStructElt member is used by this function.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camDilateCircle5 ( CamImage source,
CamImage dest 
)

Dilation (Optimized for diameter-5 circle structural element).

Computes the dilated image of a source image, using a circular structural element of diameter 5. Highly optimized code.

Parameters:
source The source CamImage to process. Must be a grey-level image.
dest The destination CamImage. Must be a grey-level image.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camDilateCircle7 ( CamImage source,
CamImage dest 
)

Dilation (Optimized for diameter-7 circle structural element).

Computes the dilated image of a source image, using a circular structural element of diameter 7. Highly optimized code.

Parameters:
source The source CamImage to process. Must be a grey-level image.
dest The destination CamImage. Must be a grey-level image.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camDilateSquare3 ( CamImage source,
CamImage dest 
)

Dilation (3x3 square structural element).

Computes the dilated image of a source image, using a classical 3x3 square structural element. Highly optimized code.

Parameters:
source The source CamImage to process. Must be a grey-level image.
dest The destination CamImage. Must be a grey-level image.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camDyadicArithm ( CamImage source1,
CamImage source2,
CamImage dest,
CamArithmParams params 
)

This is the function that implements all the dyadic arithmetic operators (i.e. operators with two operands).

This function can be used to compute the sum of two images (CAM_ARITHM_ADD), to substract two images (CAM_ARITHM_SUB), to compute the absolute difference between two images (CAM_ARITHM_ABSDIFF), to compute the weighted sum of two images (CAM_ARITHM_WEIGHTED_SUM), etc. (see below)

Parameters:
source1 The first source CamImage to process. Any source image can be either grey-level or binary, depending on the operation to apply.
source2 The second source CamImage to process. Any source image can be either grey-level or binary, depending on the operation to apply.
dest The destination CamImage. The destination image can be either a grey-level image or a binary image, but source1, source2 and dest must be of the same kind.
params A pointer to a CamArithmParams structure, defining all the parameters of the function to apply to the source images.
Here are the details on the operations and parameters to set in the CamArithmParams structure :

Returns:
0 (false) if an error occurs. An accumulator of all results pixel values otherwise.
Note that this kernel supports in-place processing (i.e. dest can be the same as one of the sources).

Note also that this kernel supports signed images, and thus can produce signed results (see the member depth in CamImage structure).

int camErode3x3 ( CamImage source,
CamImage dest,
CamMorphoMathsKernel kernel 
)

3x3 neighborhood erosion

Parameters:
source The source CamImage to process
dest The destination CamImage
kernel A pointer to a CamMorphoMathsKernel structure, defining the structural element to use. Only the ErosionStructElt member is used by this function.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camErode5x5 ( CamImage source,
CamImage dest,
CamMorphoMathsKernel kernel 
)

5x5 neighborhood erosion

Parameters:
source The source CamImage to process
dest The destination CamImage
kernel A pointer to a CamMorphoMathsKernel structure, defining the structural element to use. Only the ErosionStructElt member is used by this function.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camErode7x7 ( CamImage source,
CamImage dest,
CamMorphoMathsKernel kernel 
)

7x7 neighborhood erosion

Parameters:
source The source CamImage to process
dest The destination CamImage
kernel A pointer to a CamMorphoMathsKernel structure, defining the structural element to use. Only the ErosionStructElt member is used by this function.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camErodeCircle5 ( CamImage source,
CamImage dest 
)

Erosion (Optimized for diameter-5 circle structural element).

Computes the eroded image of a source image, using a circular structural element of diameter 5. Highly optimized code.

Parameters:
source The source CamImage to process. Must be a grey-level image.
dest The destination CamImage. Must be a grey-level image.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camErodeCircle7 ( CamImage source,
CamImage dest 
)

Erosion (Optimized for diameter-7 circle structural element).

Computes the eroded image of a source image, using a circular structural element of diameter 7. Highly optimized code.

Parameters:
source The source CamImage to process. Must be a grey-level image.
dest The destination CamImage. Must be a grey-level image.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camErodeSquare3 ( CamImage source,
CamImage dest 
)

Erosion (3x3 square structural element).

Computes the eroded image of a source image, using a classical 3x3 square structural element. Highly optimized code.

Parameters:
source The source CamImage to process. Must be a grey-level image.
dest The destination CamImage. Must be a grey-level image.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camFillColor ( CamImage image,
int  x,
int  y,
int  fillcolor,
int  tolerance 
)

Fill a region with a color.

Try to fill the image with pixels as much possible pixels with the same color as the original pixel color in (x,y)

Parameters:
x horizontal coordinate where to start the filling
y vertical coordinate where to start the filling
fillcolor filling color (use CAM_RGB or CAM_RGBA macros to set this color)
tolerance this sets where the filling should stop. The reference is the color of the original pixel color in (x,y), and all the pixels nearby that are within the tolerance parameters get filled. If tolerance is set to -1, the filling stops with pixels having the same color as the filling color (this mode is very useful for filling circles, rectangles, etc.)
Returns:
The number of colored pixels (at least 1 is function succeeds)

int camFixedFilter ( CamImage source,
CamImage dest,
int  filter 
)

Linear convolution with a predefined kernel.

The function camFixedFilter() is used to convolve the input image with a predefined filter kernel specified in argument.

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
filter Constant defining the kernel to be used. The filter kernel can be one of the following :
  • CAM_SOBEL_H performs a horizontal edges detection (3x3 sobel)
  • CAM_SOBEL_V performs a vertical edges detection (3x3 sobel)
  • CAM_GAUSSIAN_3x3 performs a gaussian filtering
  • CAM_GAUSSIAN_5x5 performs a gaussian filtering
  • CAM_GAUSSIAN_7x7 performs a gaussian filtering
  • CAM_SCHARR_H performs a horizontal edges detection (3x3 scharr filter. Better preserves gradient direction)
  • CAM_SCHARR_V performs a vertical edges detection (3x3 scharr filter. Better preserves gradient direction)
Returns:
1 if the function succeeds. 0 otherwise.
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camHarris ( CamImage source,
CamKeypoints points,
int  k 
)

Harris corner detector.

Parameters:
k Harris' corner detection parameter (default value is 41, matching k=0.04 in Harris' article)

int camHierarchicalWatershed ( CamImage source,
CamImage dest,
CamTableOfBasins tob 
)

2D Hierarchical watershed computation

Retrieves all the basins (regional segmentation)

Watersheding computes a hierarchichal segmentation of an image. Watersheding operation is a very smart way to analyze the results of a gradient image.

Parameters:
source The CamImage for which to compute the watershed
dest A 16-bits deep CamImage where the results of the watersheding operation are stored. The index of the basin is given by the pixel value minus 1 (so starting at 1). Border pixels are set to -32768. dest must be allocated by the caller, and must have the same size as the source image. It must also be a signed 16 bits deep image (CAM_DEPTH_16S).
tob The table of basins, containing their dynamics, their surface and their minimum value. This table is allocated by the function.
Returns:
0 (false) if an error occurs

int camHierarchicalWatershedContours ( CamImage source,
CamImage dest,
CamTableOfBasins tob 
)

2D Hierarchical watershed computation (with watershed/contours markers)

Retrieves all the watershed points, along with all the basins (regional segmentation)

Watersheding computes a hierarchichal segmentation of an image. Watersheding operation is a very smart way to analyze the results of a gradient image.

Parameters:
source The CamImage for which to compute the watershed
dest A 16-bits deep CamImage where the results of the watersheding operation are stored. A negative pixel value indicates a watershed point. A positive indicates that this pixel belongs to a basin. The index of the basin is given by the pixel value minus 1. Border pixels are set to -32768. dest must be allocated by the caller, and must have the same size as the source image. It must also be a signed 16 bits deep image (CAM_DEPTH_16S).
tob The table of basins, containing their dynamics, their surface and their minimum value. This table is allocated by the function.
Returns:
0 (false) if an error occurs

int camHierarchicalWatershedRegions ( CamImage watershed,
CamTableOfBasins tob 
)

Retrieves regions from a watershed image.

Retrieves all the regions of basins with surface different from 0. The user can set the surface of a basin in the table of basins to deselect it. Thus, the user can remove from the watershed image all the basins with low dynamics, and the pixels of this basin will be affected to a flooding basin.

Returns:
0 (false) if an error occurs

int camHistogram ( CamImage image,
CamTable histo 
)

The classical image histogramming.

Counts the number of occurence of each pixel value, on one channel only (grey-level image), for images up to 12-bits deep. It supports signed images by centering the histogram around the 0 value.

Parameters:
image The CamImage to analyze. One channel only.
histo A pointer to a CamTable (array of integers) that will contain the results of histogramming.
Returns:
0 (false) if an error occurs. Accumulated values of scanned pixels otherwise.
camHistogram supports masking and ROIs.

int camHistogram2Channels ( CamImage image,
int  ch1,
int  ch2,
CamImage result,
int  size 
)

Two channels histogram computation.

The result of this operation is 2D, and thus is stored in an image.

Parameters:
image The CamImage for which to compute the histogram
ch1 The first channel number
ch2 The second channel number
result The CamImage containing the results of histogramming.
size Subsampling factor. size=1 results in a 256x256 picture, size=2 results in a 128x128 picture, etc.
Returns:
0 (false) if an error occurs.

int camHistogramEqualization ( CamImage src,
CamImage dest,
CamTable src_histo,
int  option,
CamImage work 
)

Histogram Equalization.

Performs a histogram equalization, with no holes.

Parameters:
src The CamImage to equalize. One channel only.
dest The resulting equalized image.
src_histo The histogram of the source image, obtained by a previous call to camHistogram().
option CAM_EQUAL_FAST or CAM_EQUAL_PERFECT (default)
work A CamImage used for internal computation. If set to NULL, allocation and deallocation will be done internally.
Returns:
0 (false) if an error occurs.
camHistogramEqualization supports in-place operation, masking and ROIs.

int camHoughCircle ( CamImage image,
int  percent,
int  rmin,
int  rmax,
int *  xc,
int *  yc,
int *  rc 
)

Circle Hough. Find a circle in a picture.

Find a circle in the input picture. Returns the circle with the bigger hough accumulation.

Parameters:
image The CamImage to process
percent The percentage of pixels to consider (from the gradient image). Directly proportionnal to the speed of exection. Typically 10.
rmin The minimum radius to look for
rmax The maximum radius to look for. This determines the size of the (x,y,r) Hough cube
xc A pointer to the circle center (return value)
yc A pointer to the circle center (return value)
rc A pointer to the circle radius (return value)
Returns:
The confidence in the circle found (hough accumulator)

int camIntersectionSegments ( CamPoint  p[4],
CamPoint res 
)

Simple helper function, used by camWarping().

Parameters:
p An array defining the segments to intersect (AB and CD). These points must be provided in 16-bits fixed-point arithmetic form (1 is (1<<16)).
res The intersection point.
Returns:
0 if the segments are parallel. 1 otherwise

int camLabeling ( CamImage source,
CamImage dest,
CamLabelingResults results 
)

4-connectedness labeling function

Computes the labeled image of a source image, i.e. finds the connected pixels (using 4-connectedness)

Parameters:
source The source CamImage to process. Must be a grey-level image.
dest The destination CamImage..Must be 16-bits deep (its the label result image)
results The CamLabelingResults containing the label equivalence table, to provide to a blob analysis function.
Returns:
0 (false) if an error occurs
Note that this function is rather obsolete. This pixel-based labeling algorithm is outdated compared to RLE-based labeling.

See also:
camRLELabeling

int camLabeling2ndScan ( CamImage image,
CamLabelingResults results 
)

Second scan for pixel-based labeling. Obsolete.

This algorithm is useless. Presented here for better understanding purpose only. Indeed, Blob analysis first scan (camBlobAnalysis1stScan()) integrates this second scan. In-place processing only.

int camLinearFilter3x3 ( CamImage source,
CamImage dest,
CamLinearFilterKernel params 
)

3x3 Linear Filtering function

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
params A pointer to a CamLinearFilterKernel structure, providing the linear kernel to use.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camLinearFilter5x5 ( CamImage source,
CamImage dest,
CamLinearFilterKernel params 
)

5x5 Linear Filtering function

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
params A pointer to a CamLinearFilterKernel structure, providing the linear kernel to use.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camLinearFilterAbs3x3 ( CamImage source,
CamImage dest,
CamLinearFilterKernel params 
)

3x3 Linear Filtering function (absolute)

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
params A pointer to a CamLinearFilterKernel structure, providing the linear kernel to use.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camLinearFilterAbs5x5 ( CamImage source,
CamImage dest,
CamLinearFilterKernel params 
)

5x5 Linear Filtering function (absolute)

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
params A pointer to a CamLinearFilterKernel structure, providing the linear kernel to use.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

float camMeasureAverageDeviation ( CamImage image,
int  average 
)

Average deviation computation.

This makes the second scan required for average deviation estimation. Uses the average field in CamMeasuresResults structure, so camMeasures() must have been called prior to this function (to do the 1st scan).

Parameters:
image The CamImage to process (or its ROI)
average A former measure of average. If 0 or a negative number is provided, the average will be computed
Returns:
0 (false) if an error occurs.

int camMeasures ( CamImage image,
CamMeasuresResults results 
)

Measures in an image : min, max, average and sum.

Average deviation is not measured. See camMeasureAverageDeviation().

Parameters:
image The CamImage to process (or its ROI)
results The CamMeasuresResults structure to be filled.
Returns:
0 (false) if an error occurs.

int camMedianFilter3x3 ( CamImage source,
CamImage dest 
)

3x3 Median Filtering function

For each 3x3 set of pixels, keep the median value. Considered as being a good filter, less sensitive to noise.than linear filtering.

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
Returns:
0 (false) if an error occurs
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camMedianFilter5x5 ( CamImage source,
CamImage dest 
)

5x5 Median Filtering function

For each 5x5 set of pixels, keep the median value. Considered as being a good filter, less sensitive to noise.than linear filtering.

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
Returns:
0 (false) if an error occurs
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camMonadicArithm ( CamImage source,
CamImage dest,
CamArithmParams params 
)

This is the function that implements all the monadic arithmetic operators (i.e. operators with only one operand).

This function can be used to compute the absolute value of an image (CAM_ARITHM_ABS), to invert an image (CAM_ARITHM_INVERSE), to select all pixels with a given value in an image (CAM_ARITHM_SELECT), to threshold an image either with one threshold value (CAM_ARITHM_THRESHOLD), or two threshold values (CAM_ARITHM_DOUBLE_THRESHOLD)

Parameters:
source The source CamImage to process. The source must be a grey-level image, except when the operation is an image inversion (CAM_ARITHM_INVERSE).
dest The destination CamImage. The destination image can be either a grey-level image or a binary image. In the latter case, CAM_ARITHM_ABS is not a valid operation
params A pointer to a CamArithmParams structure, defining all the parameters of the function to apply to the source image.
Here are the details on the operations and parameters to set in the CamArithmParams structure :

Returns:
0 (false) if an error occurs. An accumulator of all results pixel values otherwise.
Note that this kernel supports in-place processing (i.e. dest can be the same as source param).

int camMorphoGradientCircle5 ( CamImage source,
CamImage dest 
)

Morphological gradient computation (Diameter-5 circle structural element).

Computes the morphological gradient of an image.

Uses a circular structural element of diameter 5. It is twice faster than the original morpho maths kernel.

Parameters:
source The source CamImage to process. Must be a grey-level image.
dest The destination CamImage. Must be a grey-level image.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camMorphoGradientCircle7 ( CamImage source,
CamImage dest 
)

Morphological gradient computation (Diameter-7 circle structural element).

Computes the morphological gradient of an image.

Uses a circular structural element of diameter 7. It is twice faster than the original morpho maths kernel.

Parameters:
source The source CamImage to process. Must be a grey-level image.
dest The destination CamImage. Must be a grey-level image.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camMorphoGradientSquare3 ( CamImage source,
CamImage dest 
)

Morphological gradient computation (3x3 square structural element).

Computes the morphological gradient of an image.

Uses a 3x3 square structural element (very classical). Highly optimized code.

Parameters:
source The source CamImage to process. Must be a grey-level image.
dest The destination CamImage. Must be a grey-level image.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

int camMorphoMaths ( CamImage source,
CamImage dest,
CamMorphoMathsKernel kernel 
)

This is the function that can compute erosion AND dilation in one scan (with 5x5 neighborhood).

It can be used to compute thinning, thickening, or morphological gradient in one scan. If only erosion or dilation is needed, it's more simple (and a bit faster) to use the dedicated functions.

Parameters:
source The source CamImage to process
dest The destination CamImage
kernel A pointer to a CamMorphoMathsKernel structure, defining the structural elements, as well as the behaviour of the kernel.
Returns:
Sum (Accumulator) of all computed pixels
Note that this kernel supports in-place processing (i.e. dest can be the same as source param)

int camMul ( CamImage source1,
CamImage source2,
CamImage dest 
)

Image multiplication.

Simple wrapper for camDyadicArithm()

int camPlot ( CamImage image,
int  x,
int  y,
int  color,
int  kind 
)

Plot.

Plots a point (CAM_POINT), a cross (CAM_CROSS), a circle (CAM_CIRCLE) or a combination of them (CAM_CROSS|CAM_CIRCLE for instance)

int camRefCopy ( CamImage source,
CamImage dest 
)

Reference copy.

This function doesn't copy the pixels, only the structure. Destination image will reference the same pixels as the source image. The image will be freed when source will be deallocated through camDeallocateImage() function.

int camRGB ( int  r,
int  g,
int  b 
)

24 bits integer color representation. Stricly equivalent to the Windows RGB macro.

Please use this one in place of RGB for better portability of the code.

int camRLEAllocate ( CamRLEImage rle,
int  max_runs 
)

RLE Image allocation.

Allocates a RLE image.

Parameters:
rle The CamRLEImage to allocate. The number of runs should be chosen so that it is enough to encode the image to process. A typical value used for this parameter is source.width*source.height/16, assuming a typical run will of length 16. Note that this is very realistic when the original image was thresholded and filtered.
max_runs The number of runs to allocate.
Returns:
0 (false) if an error occurs.
Note that this function uses the standard C malloc() function.

Note also that the amount of memory allocated is 8*max_runs bytes. Thus, using the typical max_runs value exposed above, a grey-level image will be compressed by a factor of 2, and a binary image expanded by a factor of 4 using RLE encoding.

The RLE image should be deallocated using the camRLEDeallocate() function, or by calling the standard C function free() on the runs member of the CamRLEImage structure.

int camRLEApplyLUT ( CamRLEImage src,
CamRLEImage dest,
CamTable LUT 
)

The RLE "Apply a LUT" function.

Very useful to post-process a RLE image. This function join runs when needed.

Applying a LUT (i.e. for instance thresholding) can be useful for many purposes (like "several thresholds at once" processing). For experts only.

Parameters:
src The source CamRLEImage.
dest The destination CamRLEImage.
LUT Look-up-table applied to the value member of each run.
Returns:
0 (false) if an error occurs.

int camRLEBlobAnalysis ( CamRLEImage src,
CamBlobs results 
)

The RLE Blob Analysis function.

Automatically called by camRLELabeling().

Parameters:
src The source CamRLEImage, already labelled.
results The CamBlobs containing the results of the blob analysis.
Returns:
0 (false) if an error occurs. Generally when the number of blobs exceeds the CAM_LABEL_MAX_BLOBS constant.

int camRLEClone ( CamRLEImage source,
CamRLEImage dest 
)

RLE image cloning.

Clone a RLE image.

Parameters:
source The CamRLEImage to clone.
dest The CamRLEImage to allocate (shouldn't be allocated)
Returns:
0 (false) if an error occurs.
Note that this function uses the standard C malloc() function.

int camRLEDeallocate ( CamRLEImage rle  ) 

RLE image deallocation.

Release a RLE image memory. Should be matched with a call to camRLEAllocate()

Parameters:
rle The CamRLEImage to deallocate.
Returns:
0 (false) if an error occurs.
Note that this function uses the standard C free() function.

int camRLEDecode ( CamRLEImage src,
CamImage dest,
CamTable LUT 
)

The RLE decoding function.

Reconstructs an CamImage from runs.

Parameters:
src The source CamRLEImage.
dest The destination CamImage. Must be grey-level image (binary image RLE decoding not yet implemented).
LUT Look-up-table applied to the value member of each run, to produce the pixel value in the dest image.
Returns:
0 (false) if an error occurs.
Todo:
Implement binary image RLE decoding

int camRLEDecodeBlobs ( CamRLEImage src,
CamImage dest,
CamTable LUT 
)

Another RLE decoding function, used to retrieve some specific blobs.

Reconstructs an CamImage from a labelled RLE image. Very useful to see the result of labeling.

Parameters:
src The source CamRLEImage.
dest The destination CamImage. Must be grey-level image (binary image RLE decoding not yet implemented).
LUT Look-up-table applied to the blob member of each run, to produce the pixel value in the dest image.
Returns:
0 (false) if an error occurs.
Todo:
Implement binary image RLE decoding

int camRLEEncode ( CamImage src,
CamRLEImage dest 
)

Run-Length encoding.

Parameters:
src The source CamImage to encode. This should be either a thresholded image or a binary image. Note that this source image should be filtered (using camErode3x3() for instance) before encoding, in order to avoid a too high number of runs.
dest The CamRLEImage resulting of the encoding.
Returns:
0 (false) if an error occurs.
Note that binary images encoding was optimized.

int camRLEEncodeLUT ( CamImage src,
CamRLEImage dest,
CamTable LUT 
)

Run-Length encoding, with integrated LUT operations.

Introduced v1.9.

Parameters:
src The source CamImage to encode. This must be a grey-level image. Note that this source image should be filtered (using camErode3x3() for instance) before encoding, in order to avoid a too high number of runs.
dest The CamRLEImage resulting of the encoding.
LUT An array of integer used to classify the source image pixels.
Returns:
0 (false) if an error occurs.

int camRLEEncodeThreshold ( CamImage src,
CamRLEImage dest,
int  threshold 
)

Run-Length encoding, with integrated thresholding.

Parameters:
src The source CamImage to encode. This must be a grey-level image. Note that this source image should be filtered (using camErodeSquare3() for instance) before encoding, in order to avoid a too high number of runs.
dest The CamRLEImage resulting of the encoding.
threshold The threshold used. All pixels with value higher (>=) than threshold will be labelled..
Returns:
0 (false) if an error occurs.

int camRLEEncodeThresholdInv ( CamImage src,
CamRLEImage dest,
int  threshold 
)

Run-Length encoding, with integrated thresholding.

Parameters:
src The source CamImage to encode. This must be a grey-level image. Note that this source image should be filtered (using camErodeSquare3() for instance) before encoding, in order to avoid a too high number of runs.
dest The CamRLEImage resulting of the encoding.
threshold The threshold used. All pixels with value lower (>=) than threshold will be labelled..
Returns:
0 (false) if an error occurs.

int camRLEErode3x2 ( CamRLEImage image,
CamRLEImage result 
)

RLE image erosion (3x2 square structural element).

Parameters:
image The source CamRLEImage.
result The destination CamRLEImage
Returns:
0 (false) if an error occurs.

int camRLEErode3x3 ( CamRLEImage image,
CamRLEImage result 
)

RLE image erosion (3x3 square structural element).

Parameters:
image The source CamRLEImage.
result The destination CamRLEImage
Returns:
0 (false) if an error occurs.

int camRLEErodeCross ( CamRLEImage image,
CamRLEImage result 
)

RLE image erosion (cross structural element).

Parameters:
image The source CamRLEImage.
result The destination CamRLEImage
Returns:
0 (false) if an error occurs.

int camRLEInverse ( CamRLEImage image  ) 

RLE image inversion.

Very useful function, for finding holes in blobs.

Parameters:
image The source and destination CamRLEImage. In-place processing only.
Returns:
0 (false) if an error occurs.

int camRLELabeling ( CamRLEImage src,
CamBlobs results 
)

RLE image labeling + blob analysis. 4-connectedness labeling.

Very fast labeling algorithm originally introduced by the Carneggie Mellon University (see below). This function also performs a basic blob analysis

Parameters:
src The source CamRLEImage to label. Note that the content of src is altered, for RLE labeling is performed in-place. This is what makes it especially fast, since it doesn't require neither an additional label image nor an equivalence table, everything being stored in the CamRLEImage structure.
results The CamBlobs containing the results of the blob analysis.
Returns:
0 (false) if an error occurs. Generally when the number of blobs exceeds the CAM_LABEL_MAX_BLOBS constant.
This code is based on the ideas developped in the CMVision library by CMU.


 -------------------------------------------------------------------------
  Copyright 1999, 2000         #### ### ### ## ## ## #### ##  ###  ##  ##
  James R. Bruce              ##    ####### ## ## ## ##   ## ## ## ######
  School of Computer Science  ##    ## # ## ## ## ##  ### ## ## ## ## ###
  Carnegie Mellon University   #### ##   ##  ###  ## #### ##  ###  ##  ##
 -------------------------------------------------------------------------

 * 

int camRLEReallocate ( CamRLEImage rle,
int  new_max_runs 
)

RLE image reallocation.

Reallocates a RLE image.

Parameters:
rle The CamRLEImage to reallocate.
new_max_runs The new number of allocated runs
Returns:
0 (false) if an error occurs.
Note that this function uses the standard C realloc() function.

int camScale ( CamImage source,
CamImage dest 
)

Scaling function.

This function operates a scaling from the source image to the destination image. It can upscale or downscale pictures, and uses bilinear interpolation technique.

Parameters:
source The CamImage to warp
dest The warped image

int camSepFilter3x3 ( CamImage source,
CamImage dest,
CamSepFilterKernel kernel 
)

3x3 Linear Filtering function with a separable kernel

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
kernel A pointer to a CamSepFilterKernel structure, specifying the separable linear kernel to use.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camSepFilter5x5 ( CamImage source,
CamImage dest,
CamSepFilterKernel kernel 
)

5x5 Linear Filtering function with a separable kernel

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
kernel A pointer to a CamSepFilterKernel structure, specifying the separable linear kernel to use.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camSepFilter7x7 ( CamImage source,
CamImage dest,
CamSepFilterKernel kernel 
)

7x7 Linear Filtering function with a separable kernel

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
kernel A pointer to a CamSepFilterKernel structure, specifying the separable linear kernel to use.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camSepFilterAbs3x3 ( CamImage source,
CamImage dest,
CamSepFilterKernel kernel 
)

3x3 Linear Filtering function with a separable kernel (absolute value)

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
kernel A pointer to a CamSepFilterKernel structure, specifying the separable linear kernel to use.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camSepFilterAbs5x5 ( CamImage source,
CamImage dest,
CamSepFilterKernel kernel 
)

5x5 Linear Filtering function with a separable kernel (absolute value)

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
kernel A pointer to a CamSepFilterKernel structure, specifying the separable linear kernel to use.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camSepFilterAbs7x7 ( CamImage source,
CamImage dest,
CamSepFilterKernel kernel 
)

7x7 Linear Filtering function with a separable kernel (absolute value)

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
kernel A pointer to a CamSepFilterKernel structure, specifying the separable linear kernel to use.
Returns:
Sum (Accumulator) of all computed pixels
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camSobelH ( CamImage source,
CamImage dest 
)

3x3 Horizontal Sobel Filter. Detects horizontal edges.

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
Returns:
1 if the function succeeds. 0 otherwise.
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camSobelHAbs ( CamImage source,
CamImage dest 
)

3x3 Horizontal Sobel Filter (absolute). Detects horizontal edges.

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
Returns:
1 if the function succeeds. 0 otherwise.
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camSobelV ( CamImage source,
CamImage dest 
)

3x3 Vertical Sobel Filter. Detects Vertical edges.

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
Returns:
1 if the function succeeds. 0 otherwise.
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camSobelVAbs ( CamImage source,
CamImage dest 
)

3x3 Vertical Sobel Filter (absolute). Detects Vertical edges.

Parameters:
source The source CamImage to process. Grey scale only.
dest The destination CamImage
Returns:
1 if the function succeeds. 0 otherwise.
Note that this function supports in-place processing (i.e. dest can be the same as source param)

Note also that signed saturation is to (-127;+127) instead of the traditional signed char (-128;+127), so that results of filtering are unbiased.

int camSub ( CamImage source1,
CamImage source2,
CamImage dest 
)

Image subtraction.

Simple wrapper for camDyadicArithm()

int camSumH ( CamImage image,
CamTable results 
)

Horizontal summing function.

Very useful to detect features in images, generally after applying a filter like sobel or morphological gradient.

Parameters:
image The CamImage to process (or its ROI)
results The CamTable array of integers filled with results.
Returns:
0 (false) if an error occurs.

int camSumHV ( CamImage image,
CamTable hsum,
CamTable vsum 
)

Horizontal and vertical summing function.

Very useful to detect features in images, generally after applying a filter like sobel or morphological gradient.

Parameters:
image The CamImage to process (or its ROI)
hsum The CamTable array of integers containing the horizontal sum.
vsum The CamTable array of integers containing the vertical sum.
Returns:
0 (false) if an error occurs.

int camSumV ( CamImage image,
CamTable results 
)

Vertical summing function.

Very useful to detect features in images, generally after applying a filter like sobel or morphological gradient.

Parameters:
image The CamImage to process (or its ROI)
results The CamTable array of integers filled with results.
Returns:
0 (false) if an error occurs.

int camThreshold ( CamImage source,
CamImage dest,
int  threshold 
)

Simple threshold function (wrapper for camMonadicArithm() function).

Turn all pixels below (<) the threshold value to 0, and all pixels above (>=) to 255

int camThresholdInv ( CamImage source,
CamImage dest,
int  threshold 
)

Simple threshold function (wrapper for camMonadicArithm() function).

Turn all pixels below (<) the threshold value to 255, and all pixels above (>=) to 0

void camVolbergFwd ( CamImage source,
CamImage dest,
CamVolbergFwdParams params 
)

Helper function for using Volberg's warping algorithm.

Parameters:
source The CamImage to warp
dest The warped image
params The camVolbergFwdParams structure providing the mapping functions

void camVolbergFwdScanline ( CAM_PIXEL *  in,
int  inlen,
CAM_PIXEL *  out,
int  outlen,
double  f[] 
)

Warping using Volberg's algorithm.

This is a forward separable mapping algorithm, i.e. the user must provide two functions that compute the destination points of any source point.

This function is the core function, making a single scanline mapping. It must be called twice to have a full mapping. Use camVolbergFwd() to do this.

int camWarping ( CamImage source,
CamImage dest,
CamWarpingParams params 
)

Backward warping function.

This function operates a backward mapping from the source image to a destination image. All the params refer to locations in the source image, whereas the ROI scanned by this warping function is set by the roi member of the dest image

Parameters:
source The CamImage to warp
dest The warped image
params The CamWarpingParams structure providing the ROI in the source image (not rectangular)

int camWatershed1D ( int *  input,
int  size,
int *  results 
)

1D watershed computation

Retrieves all the watershed points, along with their depth (i.e. the minimum depth of the 2 catchment bassins contributing to the watershed point).

1D watersheding operation is a very smart way to analyze the results of an histogram (generally before thresholding), yielding better results than a simple n% threshold.

Parameters:
input The 1D integer data for which to compute the watershed
size The size of the 1D integer array (t). Generally 256 when t is the results of an histogramming operation.
results The 1D integer array contaning the results of the watershed computation. A value different from 0 indicates a watershed point, the value indicating the depth (and thus the importance) associated to this watershed point. The memory for this array is not allocated by this function, and thus an array of appropriate size must be allocated before calling this function.
Returns:
0 (false) if an error occurs


Generated on Thu Jan 3 16:41:07 2008 for Camellia by  doxygen 1.5.3