Single-Linkage Region Growing

#include "BIVISION.H"

 

WORD ** CALLBACK  FilterSingleLRG( HANDLE          hDIB,
int                       iMaxDiff,
NormOperator    lpNormOpFunc,
BOOL                b4Neighbouring,
WORD *            lpRegNum,
int *                    lpWidth,
int *                    lpHeight)

Description

Segments the input image with the Single-Linkage Region Growing algorithm. This algorithm is the simplest of the region growing algorithms. Probably will be the fastest segmentation. Use this segmentation for simple images (free of noise, low entropy, well separatable regions). For some images Centroid-Linkage Region Growing algorithm can be faster than this.

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 )

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.