Mamba C API reference

Version 2.0

MB_Api_neighbors.h File Reference

Go to the source code of this file.

Functions

MB_API_ENTRY MB_errcode MB_API_CALL MB_InfNb (MB_Image *src, MB_Image *srcdest, Uint32 neighbors, enum MB_grid_t grid, enum MB_edgemode_t edge)
 
MB_API_ENTRY MB_errcode MB_API_CALL MB_InfFarNb (MB_Image *src, MB_Image *srcdest, Uint32 nbrnum, Uint32 count, enum MB_grid_t grid, enum MB_edgemode_t edge)
 
MB_API_ENTRY MB_errcode MB_API_CALL MB_SupNb (MB_Image *src, MB_Image *srcdest, Uint32 neighbors, enum MB_grid_t grid, enum MB_edgemode_t edge)
 
MB_API_ENTRY MB_errcode MB_API_CALL MB_SupFarNb (MB_Image *src, MB_Image *srcdest, Uint32 nbrnum, Uint32 count, enum MB_grid_t grid, enum MB_edgemode_t edge)
 
MB_API_ENTRY MB_errcode MB_API_CALL MB_DiffNb (MB_Image *src, MB_Image *srcdest, Uint32 neighbors, enum MB_grid_t grid, enum MB_edgemode_t edge)
 
MB_API_ENTRY MB_errcode MB_API_CALL MB_BldNb (MB_Image *mask, MB_Image *srcdest, Uint32 dirnum, Uint64 *pVolume, enum MB_grid_t grid)
 
MB_API_ENTRY MB_errcode MB_API_CALL MB_DualBldNb (MB_Image *mask, MB_Image *srcdest, Uint32 dirnum, Uint64 *pVolume, enum MB_grid_t grid)
 
MB_API_ENTRY MB_errcode MB_API_CALL MB_Shift (MB_Image *src, MB_Image *dest, Uint32 dirnum, Uint32 count, Uint32 long_filler_pix, enum MB_grid_t grid)
 
MB_API_ENTRY MB_errcode MB_API_CALL MB_ShiftVector (MB_Image *src, MB_Image *dest, Sint32 dx, Sint32 dy, Uint32 long_filler_pix)
 
MB_API_ENTRY MB_errcode MB_API_CALL MB_InfVector (MB_Image *src, MB_Image *srcdest, Sint32 dx, Sint32 dy, enum MB_edgemode_t edge)
 
MB_API_ENTRY MB_errcode MB_API_CALL MB_SupVector (MB_Image *src, MB_Image *srcdest, Sint32 dx, Sint32 dy, enum MB_edgemode_t edge)
 
MB_API_ENTRY MB_errcode MB_API_CALL MB_BinHitOrMiss (MB_Image *src, MB_Image *dest, Uint32 es0, Uint32 es1, enum MB_grid_t grid, enum MB_edgemode_t edge)
 

Function Documentation

MB_API_ENTRY MB_errcode MB_API_CALL MB_BinHitOrMiss ( MB_Image src,
MB_Image dest,
Uint32  es0,
Uint32  es1,
enum MB_grid_t  grid,
enum MB_edgemode_t  edge 
)

Performs a binary Hit-or-Miss operation on src image using the structuring elements es0 and es1. Structuring elements are integer values coding which direction must be taken into account. es0 indicates which neighbor of the current pixel will be checked for 0 value. es1 those which will be evaluated for 1 value.

For example, in hexagonal grid, it means that if you want to look for a pattern where the neighbors in direction 6 and 1 are true while the current pixel is false just as neighbors 2 and 5, you will encode this in the elements es0 and es1 like this :

 es0 = 1+4+32

 es1 = 64+2
See also
MB_Neighbors_code_t for encoded structuring elements.
Parameters
srcoutput image
destinput image (must be different of src)
es0structuring element for 0 value.
es1structuring element for 1 value.
gridgrid configuration
edgethe kind of edge to use (behavior for pixel near edge depends on it)
Returns
An error code (NO_ERR if successful)
MB_API_ENTRY MB_errcode MB_API_CALL MB_BldNb ( MB_Image mask,
MB_Image srcdest,
Uint32  dirnum,
Uint64 pVolume,
enum MB_grid_t  grid 
)

(re)Builds an image according to a direction and a mask image. The direction depends on the grid used.

Parameters
maskthe mask image
srcdestthe rebuild image
dirnumthe direction number
pVolumethe computed volume of the output image
gridthe grid used (either square or hexagonal)
Returns
An error code (NO_ERR if successful)
MB_API_ENTRY MB_errcode MB_API_CALL MB_DiffNb ( MB_Image src,
MB_Image srcdest,
Uint32  neighbors,
enum MB_grid_t  grid,
enum MB_edgemode_t  edge 
)

Computes the set difference between two image pixels (a central pixel and its neighbors in the other image) The neighbor depends on the grid used. Neighbors are described using a pattern. If no neighbor is defined, the function will leave silently doing nothing.

See also
MB_Neighbors_code_t for encoding neighbors patterns.
Parameters
srcsource image in which the neighbor are taken
srcdestsource of the central pixel and destination image
neighborsthe neighbors to take into account
gridthe grid used (either square or hexagonal)
edgethe kind of edge to use (behavior for pixel near edge depends on it)
Returns
An error code (NO_ERR if successful)
MB_API_ENTRY MB_errcode MB_API_CALL MB_DualBldNb ( MB_Image mask,
MB_Image srcdest,
Uint32  dirnum,
Uint64 pVolume,
enum MB_grid_t  grid 
)

(re)Builds (dual operation) an image according to a direction and a mask image. The direction depends on the grid used.

Parameters
maskthe mask image
srcdestthe rebuild image
dirnumthe direction number
pVolumethe computed volume of the output image
gridthe grid used (either square or hexagonal)
Returns
An error code (NO_ERR if successful)
MB_API_ENTRY MB_errcode MB_API_CALL MB_InfFarNb ( MB_Image src,
MB_Image srcdest,
Uint32  nbrnum,
Uint32  count,
enum MB_grid_t  grid,
enum MB_edgemode_t  edge 
)

Looks for the minimum between two image pixels (a central pixel and its far neighbor in the other image) The neighbor depends on the grid used.

Parameters
srcsource image in which the neighbor are taken
srcdestsource of the central pixel and destination image
nbrnumthe neighbor index
countthe amplitude of the shift (in pixels)
gridthe grid used (either square or hexagonal)
edgethe kind of edge to use (behavior for pixel near edge depends on it)
Returns
An error code (NO_ERR if successful)
MB_API_ENTRY MB_errcode MB_API_CALL MB_InfNb ( MB_Image src,
MB_Image srcdest,
Uint32  neighbors,
enum MB_grid_t  grid,
enum MB_edgemode_t  edge 
)

Looks for the minimum between two image pixels (a central pixel and its neighbors in the other image) The neighbor depends on the grid used. Neighbors are described using a pattern. If no neighbor is defined, the function will leave silently doing nothing.

See also
MB_Neighbors_code_t for encoding neighbors patterns.
Parameters
srcsource image in which the neighbor are taken
srcdestsource of the central pixel and destination image
neighborsthe neighbors to take into account
gridthe grid used (either square or hexagonal)
edgethe kind of edge to use (behavior for pixel near edge depends on it)
Returns
An error code (NO_ERR if successful)
MB_API_ENTRY MB_errcode MB_API_CALL MB_InfVector ( MB_Image src,
MB_Image srcdest,
Sint32  dx,
Sint32  dy,
enum MB_edgemode_t  edge 
)

Looks for the minimum between two image pixels (a central pixel and its neighbor in the other image previously shifted by the given vector)

Parameters
srcsource image in which the neighbor are taken
srcdestsource of the central pixel and destination image
dxthe vector amplitude in x
dythe vector amplitude in y
edgethe kind of edge to use (behavior for pixels near edge depends on it)
Returns
An error code (NO_ERR if successful)
MB_API_ENTRY MB_errcode MB_API_CALL MB_Shift ( MB_Image src,
MB_Image dest,
Uint32  dirnum,
Uint32  count,
Uint32  long_filler_pix,
enum MB_grid_t  grid 
)

Shifts the contents of an image in a given direction with a given amplitude The direction depends on the grid used.

Parameters
srcsource image
destdestination image
dirnumthe direction index
countthe amplitude of the shift
long_filler_pixthe value used to fill the created space
gridthe grid used (either square or hexagonal)
Returns
An error code (NO_ERR if successful)
MB_API_ENTRY MB_errcode MB_API_CALL MB_ShiftVector ( MB_Image src,
MB_Image dest,
Sint32  dx,
Sint32  dy,
Uint32  long_filler_pix 
)

Shifts the contents of an image by a given vector.

Parameters
srcsource image
destdestination image
dxthe vector amplitude in x
dythe vector amplitude in y
long_filler_pixthe value used to fill the created space
Returns
An error code (NO_ERR if successful)
MB_API_ENTRY MB_errcode MB_API_CALL MB_SupFarNb ( MB_Image src,
MB_Image srcdest,
Uint32  nbrnum,
Uint32  count,
enum MB_grid_t  grid,
enum MB_edgemode_t  edge 
)

Looks for the maximum between two image pixels (a central pixel and its far neighbor in the other image) The neighbor depends on the grid used.

Parameters
srcsource image in which the neighbor are taken
srcdestsource of the central pixel and destination image
nbrnumthe neighbor index
countthe amplitude of the shift (in pixels)
gridthe grid used (either square or hexagonal)
edgethe kind of edge to use (behavior for pixels near edge depends on it)
Returns
An error code (NO_ERR if successful)
MB_API_ENTRY MB_errcode MB_API_CALL MB_SupNb ( MB_Image src,
MB_Image srcdest,
Uint32  neighbors,
enum MB_grid_t  grid,
enum MB_edgemode_t  edge 
)

Looks for the maximum between two image pixels (a central pixel and its neighbors in the other image) The neighbor depends on the grid used. Neighbors are described using a pattern. If no neighbor is defined, the function will leave silently doing nothing.

See also
MB_Neighbors_code_t for encoding neighbors patterns.
Parameters
srcsource image in which the neighbor are taken
srcdestsource of the central pixel and destination image
neighborsthe neighbors to take into account
gridthe grid used (either square or hexagonal)
edgethe kind of edge to use (behavior for pixel near edge depends on it)
Returns
An error code (NO_ERR if successful)
MB_API_ENTRY MB_errcode MB_API_CALL MB_SupVector ( MB_Image src,
MB_Image srcdest,
Sint32  dx,
Sint32  dy,
enum MB_edgemode_t  edge 
)

Looks for the maximum between two images pixels (a central pixel and its neighbor in the other image previously shifted by the given vector)

Parameters
srcsource image in which the neighbor are taken
srcdestsource of the central pixel and destination image
dxthe vector amplitude in x
dythe vector amplitude in y
edgethe kind of edge to use (behavior for pixels near edge depends on it)
Returns
An error code (NO_ERR if successful)