Connected Components functions

Summary
Connected Components functions
Functions
ccGetConnectedComponentsBBoxExtract the connected components’ boxes from the image.
ccGetAndLabelConnectedComponentsBBoxExtract the connected components’ boxes from the image and builds a mtr that ‘labels’ the components, giving fast access to a pixels’ corresponding Rect.
ccLabelConnectedComponentsLabel the connected components of an image using a UnionFind approach.

Functions

ccGetConnectedComponentsBBox

Rect *ccGetConnectedComponentsBBox(Image *img)

Extract the connected components’ boxes from the image.

Parameters

imgImage to extract the connected components from

Returns

A Rect list with the bounding boxes of the extracted connected components.  The Rects contain in the fill field the proportion between the area of the Rect and the area of the connected component it represents.

ccGetAndLabelConnectedComponentsBBox

Rect *ccGetAndLabelConnectedComponentsBBox(Image *img,
Matrix **rectMatrix)

Extract the connected components’ boxes from the image and builds a mtr that ‘labels’ the components, giving fast access to a pixels’ corresponding Rect.

Parameters

imgImage to extract the connected components from
labelMatrixaddress to return the mtr into

Returns

A Rect list with the bounding boxes of the extracted connected components and a matrix that labels every point of the image with its Rect.

ccLabelConnectedComponents

Matrix *ccLabelConnectedComponents(Image *img,
int *num_components)

Label the connected components of an image using a UnionFind approach.  White is considered background and Black is foreground.

Parameters

imgimage to label the connected components
num_componentspointer to store the number of components found

Returns

A mtr with labels on the connected components.

Rect *ccGetConnectedComponentsBBox(Image *img)
Extract the connected components’ boxes from the image.
Rect *ccGetAndLabelConnectedComponentsBBox(Image *img,
Matrix **rectMatrix)
Extract the connected components’ boxes from the image and builds a mtr that ‘labels’ the components, giving fast access to a pixels’ corresponding Rect.
Matrix *ccLabelConnectedComponents(Image *img,
int *num_components)
Label the connected components of an image using a UnionFind approach.
Close