Mamba C API reference
Version 2.0
Go to the source code of this file.
Functions | |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_And (MB_Image *src1, MB_Image *src2, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Or (MB_Image *src1, MB_Image *src2, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Xor (MB_Image *src1, MB_Image *src2, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Inv (MB_Image *src, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Inf (MB_Image *src1, MB_Image *src2, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Sup (MB_Image *src1, MB_Image *src2, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_SupMask (MB_Image *src1, MB_Image *src2, MB_Image *dest, Uint32 strict) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Add (MB_Image *src1, MB_Image *src2, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Sub (MB_Image *src1, MB_Image *src2, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Mul (MB_Image *src1, MB_Image *src2, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Div (MB_Image *src1, MB_Image *src2, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Diff (MB_Image *src1, MB_Image *src2, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_ConAdd (MB_Image *src, Sint64 value, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_ConSub (MB_Image *src, Sint64 value, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_ConMul (MB_Image *src, Uint32 value, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_ConDiv (MB_Image *src, Uint32 value, MB_Image *dest) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_ConSet (MB_Image *dest, Uint32 value) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Volume (MB_Image *src, Uint64 *pVolume) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Check (MB_Image *src, Uint32 *isEmpty) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Lookup (MB_Image *src, MB_Image *dest, Uint32 *ptab) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Histo (MB_Image *src, Uint32 *phisto) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Compare (MB_Image *src, MB_Image *cmp, MB_Image *dest, Sint32 *px, Sint32 *py) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Thresh (MB_Image *src, MB_Image *dest, Uint32 low, Uint32 high) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Mask (MB_Image *src, MB_Image *dest, Uint32 maskf, Uint32 maskt) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Range (MB_Image *src, Uint32 *min, Uint32 *max) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_depthRange (MB_Image *src, Uint32 *min, Uint32 *max) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_CopyBitPlane (MB_Image *src, MB_Image *dest, Uint32 plane) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_CopyBytePlane (MB_Image *src, MB_Image *dest, Uint32 plane) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Label (MB_Image *src, MB_Image *dest, Uint32 lblow, Uint32 lbhigh, Uint32 *pNbobj, enum MB_grid_t grid) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Distanceb (MB_Image *src, MB_Image *dest, enum MB_grid_t grid, enum MB_edgemode_t edge) |
MB_API_ENTRY MB_errcode MB_API_CALL | MB_Frame (MB_Image *src, Uint32 thresval, Uint32 *ulx, Uint32 *uly, Uint32 *brx, Uint32 *bry) |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Add | ( | MB_Image * | src1, |
MB_Image * | src2, | ||
MB_Image * | dest | ||
) |
Adds the pixels of two images and puts the result in the third image. Depending on the format of the target image, the result may be saturated or not. You can perform the following additions :
src1 | image 1 |
src2 | image 2 |
dest | image resulting of the addition of image 1 and 2 |
MB_API_ENTRY MB_errcode MB_API_CALL MB_And | ( | MB_Image * | src1, |
MB_Image * | src2, | ||
MB_Image * | dest | ||
) |
Performs a bitwise AND between the pixels of two images.
src1 | image 1 |
src2 | image 2 |
dest | destination image |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Check | ( | MB_Image * | src, |
Uint32 * | isEmpty | ||
) |
Verifies that the image is not empty (all pixels to 0).
src | the source image |
isEmpty | an integer which is set to 1 if empty or 0 if not |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Compare | ( | MB_Image * | src, |
MB_Image * | cmp, | ||
MB_Image * | dest, | ||
Sint32 * | px, | ||
Sint32 * | py | ||
) |
Performs a comparaison between a source image and a given base image.
src | the source image |
cmp | the image to which the source image is compared |
dest | destination image |
px | position in x of the first different pixel between the two images (-1 if images are similar) |
py | position in y of the first different pixel between the two images (-1 if images are similar) |
MB_API_ENTRY MB_errcode MB_API_CALL MB_ConAdd | ( | MB_Image * | src, |
Sint64 | value, | ||
MB_Image * | dest | ||
) |
Adds a constant value to the pixels of an image.
src | the source image |
value | the constant value to be added to the pixels |
dest | the image resulting of the addition of image 1 and value |
MB_API_ENTRY MB_errcode MB_API_CALL MB_ConDiv | ( | MB_Image * | src, |
Uint32 | value, | ||
MB_Image * | dest | ||
) |
Divides (quotient) the pixels of an image by a constant value.
src | the source image |
value | the constant value used in the division |
dest | the image resulting of the division of image 1 by the value |
MB_API_ENTRY MB_errcode MB_API_CALL MB_ConMul | ( | MB_Image * | src, |
Uint32 | value, | ||
MB_Image * | dest | ||
) |
Multiplies a constant value to the pixels of an image.
src | the source image |
value | the constant value to be multiplied to the pixels |
dest | the image resulting of the multiplication of image 1 by the value |
MB_API_ENTRY MB_errcode MB_API_CALL MB_ConSet | ( | MB_Image * | dest, |
Uint32 | value | ||
) |
Fills an image with a specific value.
dest | the image |
value | the value to fill the image |
MB_API_ENTRY MB_errcode MB_API_CALL MB_ConSub | ( | MB_Image * | src, |
Sint64 | value, | ||
MB_Image * | dest | ||
) |
Subtracts a constant value to the pixels of an image.
src | the source image |
value | the constant value to be subtracted to the pixels |
dest | the image resulting of the subtraction of image 1 and value |
MB_API_ENTRY MB_errcode MB_API_CALL MB_CopyBitPlane | ( | MB_Image * | src, |
MB_Image * | dest, | ||
Uint32 | plane | ||
) |
Inserts or extracts the bit plane in/out of image src into dest.
src | source image |
dest | destination image |
plane | the plane number |
MB_API_ENTRY MB_errcode MB_API_CALL MB_CopyBytePlane | ( | MB_Image * | src, |
MB_Image * | dest, | ||
Uint32 | plane | ||
) |
Inserts or extracts the byte plane in/out of image src into dest.
src | source image |
dest | destination image |
plane | the plane number |
MB_API_ENTRY MB_errcode MB_API_CALL MB_depthRange | ( | MB_Image * | src, |
Uint32 * | min, | ||
Uint32 * | max | ||
) |
gives the minimum and maximum possible values of the image pixels given the image depth.
src | source image |
min | the minimum possible value of the pixels |
max | the maximum possible value of the pixels |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Diff | ( | MB_Image * | src1, |
MB_Image * | src2, | ||
MB_Image * | dest | ||
) |
Computes the set difference between two images. The result image pixel value is the pixel value of image 1 if this value was greater than value of pixel 2 otherwise the minimum possible value is set for the pixel.
src1 | source image 1 |
src2 | source image 2 |
dest | destination image |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Distanceb | ( | MB_Image * | src, |
MB_Image * | dest, | ||
enum MB_grid_t | grid, | ||
enum MB_edgemode_t | edge | ||
) |
Computes for each pixel the distance to the edge of the set in which the pixel is found.
The algorithm works with a list.
src | the binary source image |
dest | the 32-bit image in which the distance for each pixel is stored |
grid | the grid used (either hexagonal or square) |
edge | the kind of edge to use (behavior for pixels near edge depends on it) |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Div | ( | MB_Image * | src1, |
MB_Image * | src2, | ||
MB_Image * | dest | ||
) |
Divides the pixels of two images and puts the result in the third image. You can perform the following multiplications :
Division by zero results in the maximum value possible for the pixels of the destination image depth.
src1 | image 1 |
src2 | image 2 |
dest | image resulting of the division of image 1 and 2 (quotient) |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Frame | ( | MB_Image * | src, |
Uint32 | thresval, | ||
Uint32 * | ulx, | ||
Uint32 * | uly, | ||
Uint32 * | brx, | ||
Uint32 * | bry | ||
) |
Returns the smallest frame that contains all the pixels of image that are greater or equal to the given threshold value, using the four last pointers to describe it.
src | source image |
thresval | the threshold value used to compute the frame |
ulx | the x-coordinate of the upper left corner of the frame |
uly | the y-coordinate of the upper left corner of the frame |
brx | the x-coordinate of the bottom right corner of the frame |
bry | the y-coordinate of the bottom right corner of the frame |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Histo | ( | MB_Image * | src, |
Uint32 * | phisto | ||
) |
Computes the histogram of an image. The histogram is an array with a minimal size of 256.
src | source image |
phisto | pointer to the histogram array |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Inf | ( | MB_Image * | src1, |
MB_Image * | src2, | ||
MB_Image * | dest | ||
) |
Determines the inferior value between the pixels of two images. The result is put in the corresponding pixel position in the destination image.
src1 | image 1 |
src2 | image 2 |
dest | destination image |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Inv | ( | MB_Image * | src, |
MB_Image * | dest | ||
) |
Inverts the pixels values (logical NOT) of the source image.
src | source image |
dest | destination image |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Label | ( | MB_Image * | src, |
MB_Image * | dest, | ||
Uint32 | lblow, | ||
Uint32 | lbhigh, | ||
Uint32 * | pNbobj, | ||
enum MB_grid_t | grid | ||
) |
Labeling the object found in src image.
src | the source image where the object must be labelled |
dest | the 32-bit image where object are labelled |
lblow | the lowest value allowed for label on the low byte (must be inferior to lbhigh) |
lbhigh | the first high value NOT allowed for label on the low byte (maximum allowed is 256) |
pNbobj | the number of object found |
grid | the grid used (either square or hexagonal) |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Lookup | ( | MB_Image * | src, |
MB_Image * | dest, | ||
Uint32 * | ptab | ||
) |
Applies the function in the lookup table to the pixels of source image. A pixel value is changed to a new value accordingly with its current value.
src | source image |
dest | destination image |
ptab | the lookup table pointer |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Mask | ( | MB_Image * | src, |
MB_Image * | dest, | ||
Uint32 | maskf, | ||
Uint32 | maskt | ||
) |
Converts a binary image in a grey scale image (8-bit) or in a 32-bit image using value maskf to replace 0 and maskt to replace 1.
src | binary source image |
dest | destination image |
maskf | for 0 (false) pixel value |
maskt | for 1 (true) pixel value |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Mul | ( | MB_Image * | src1, |
MB_Image * | src2, | ||
MB_Image * | dest | ||
) |
Multiplies the pixels of two images and puts the result in the third image. Depending on the format of the target image, the result may be saturated or not. You can perform the following multiplications :
src1 | image 1 |
src2 | image 2 |
dest | image resulting of the multiplication of image 1 and 2 |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Or | ( | MB_Image * | src1, |
MB_Image * | src2, | ||
MB_Image * | dest | ||
) |
Applies a bitwise OR on the pixels of two images. All the images must have the same depth for correct work.
src1 | image 1 |
src2 | image 2 |
dest | destination image |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Range | ( | MB_Image * | src, |
Uint32 * | min, | ||
Uint32 * | max | ||
) |
gives the minimum and maximum values of the image pixels i.e its range.
src | source image |
min | the minimum value of the pixels |
max | the maximum value of the pixels |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Sub | ( | MB_Image * | src1, |
MB_Image * | src2, | ||
MB_Image * | dest | ||
) |
Subtracts the values of pixels of the second image to the values of the pixels in the first image You can perform the following substractions :
src1 | image 1 |
src2 | image 2 |
dest | image resulting of the subtraction |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Sup | ( | MB_Image * | src1, |
MB_Image * | src2, | ||
MB_Image * | dest | ||
) |
Determines the superior value between the pixels of two images. The result is put in the corresponding pixel position in the destination image.
src1 | image 1 |
src2 | image 2 |
dest | destination image |
MB_API_ENTRY MB_errcode MB_API_CALL MB_SupMask | ( | MB_Image * | src1, |
MB_Image * | src2, | ||
MB_Image * | dest, | ||
Uint32 | strict | ||
) |
Computes a binary image where pixels are set to 1 when the pixels of image 1 have greater values than pixels of image 2 otherwise 0.
src1 | source image 1 |
src2 | source image 2 |
dest | destination image |
strict | flag indicating if the comparison is strict or large |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Thresh | ( | MB_Image * | src, |
MB_Image * | dest, | ||
Uint32 | low, | ||
Uint32 | high | ||
) |
Fills a binary image according to the following rules: if pixel value lower than low or higher than high the binary pixel is set to 0, in other cases the pixel is set to 1.
src | source image |
dest | destination image |
low | low value for threshold |
high | high value for treshold |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Volume | ( | MB_Image * | src, |
Uint64 * | pVolume | ||
) |
Computes the volume of an image. The volume is the sum of the pixel values (i.e. integration of the image).
src | source image |
pVolume | pointer to the volume variable |
MB_API_ENTRY MB_errcode MB_API_CALL MB_Xor | ( | MB_Image * | src1, |
MB_Image * | src2, | ||
MB_Image * | dest | ||
) |
Applies a bitwise XOR on the pixels of two images. All the images must have the same depth for correct work.
src1 | image 1 |
src2 | image 2 |
dest | destination image |