#include "BIVISION.H"
WORD ** CALLBACK FilterHybridLRG( HANDLE hDIB,
int iMaxDiff,
BYTE nMatrixSize,
BYTE nThresholding,
NormOperator lpNormOpFunc,
BOOL b4Neighbouring,
WORD * lpRegNum,
int * lpWidth,
int * lpHeight)
Description
Segments the input image with a Hybrid-Linkage Region Growing algorithm. Hybrid algorithms are very useful for strongly noisy images. This algorithm examines an nMatrixSize by nMatrixSize sized local context of the actual pixel. The context will be a part of a region if at least nThresholding number of pixels in the context can be added to the region.
Parameters
|
HANDLE |
hDib |
The input image to be segmented. |
|
int |
iMaxDiff |
The maximum difference between two neighbouring pixels in the same region. If iMaxDiff less than zero, Bryant difference will be used (square mean of all adjacent pixel differences normalized to |
|
BYTE |
nMatrixSize |
Size of the local context to be examined. See the description above. |
|
BYTE |
nTresholding |
Thresholding value of the local context to be examined. See the description above. |
|
NormOperator |
lpNormOpFunc |
If the input DIB is a color image, one pixel’s Red, Green and Blue values must be transformed to only one value. This parameter is a pointer to a function retrieving the 3 BYTE type color value and returning one BYTE value. See the formal definition of this function below at programming notes. If this pointer is NULL, the default transformation function will be used (square mean of the 3 values). |
|
BOOL |
b4Neighbouring |
4 or 8 pixel neighbouring. |
|
WORD * |
lpRegNum |
It’s an output parameter. If this pointer is not NULL, the function returns the number of generated regions. |
|
int * |
lpWidth |
It’s an output parameter. If this pointer is not NULL, the function returns the width of the generated region matrix (same as the width of the input image). |
|
int * |
lpHeight |
It’s an output parameter. If this pointer is not NULL, the function returns the height of the generated region matrix (same as the height of the input image). |
Return values
Handler of the generated region matrix or NULL on error.
Programming notes
typedef BYTE (CALLBACK *NormOperator)(BYTE nRedValue, BYTE nGreenValue, BYTE nBlueValue);
Requirements
Header : Declared in BiVision.h; include BiVision.h.
Library : Use BiVision.lib.
DLLs : BiVision.dll.