| VIPS Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <vips/vips.h> int im_dilate (IMAGE *in, IMAGE *out, INTMASK *m); int im_erode (IMAGE *in, IMAGE *out, INTMASK *m); int im_rank (IMAGE *in, IMAGE *out, int xsize, int ysize, int order); int im_rank_image (IMAGE **in, IMAGE *out, int n, int index); int im_maxvalue (IMAGE **in, IMAGE *out, int n); int im_cntlines (IMAGE *im, double *nolines, int flag); int im_zerox (IMAGE *in, IMAGE *out, int flag); int im_profile (IMAGE *in, IMAGE *out, int dir); int im_label_regions (IMAGE *test, IMAGE *mask, int *segments);
int im_label_regions (IMAGE *test,
IMAGE *mask,
int *segments);
The test image is repeatedly scanned and regions of 4-connected pixels
with the same pixel value found. Every time a region is discovered, those
pixels are marked in mask with a unique serial number. Once all pixels
have been labelled, the operation returns, setting segments to the number
of discrete regions which were detected.
mask is always a 1-band IM_BANDFMT_UINT image of the same dimensions as
test.
This operation is useful for, for example, blob counting. You can use the
morphological operators to detect and isolate a series of objects, then use
im_label_regions() to number them all.
Use im_histindexed() to (for example) find blob coordinates.
See also: im_histindexed()
|
image to test |
|
write labelled regions here |
|
return number of regions here |
Returns : |
0 on success, -1 on error. |