Generate a contour chain code from binary image regions. More...
Functions | |
int | rapp_contour_4conn_bin (unsigned origin[2], char *restrict contour, int len, const uint8_t *restrict buf, int dim, int width, int height) |
4-connectivity contour chain code. | |
int | rapp_contour_8conn_bin (unsigned origin[2], char *restrict contour, int len, const uint8_t *restrict buf, int dim, int width, int height) |
8-connectivity contour chain code. |
Generate a contour chain code from binary image regions.
These functions generate the chain code for the outer contour of a binary image. The contour is traced in clockwise order, starting at the first pixel found in traversal order (memory order). Only one contour is traced. To generate all contours, use the connected-components seed fill functions to segment the image into regions and then trace the contours one by one. The images must be aligned.
Next section: Chain Code Line Rasterization
int rapp_contour_4conn_bin | ( | unsigned | origin[2], | |
char *restrict | contour, | |||
int | len, | |||
const uint8_t *restrict | buf, | |||
int | dim, | |||
int | width, | |||
int | height | |||
) |
4-connectivity contour chain code.
[out] | origin | An array where to store the start position of the contour. It must have at least two elements. |
[out] | contour | Chain code contour buffer. May be NULL iff len is 0. |
len | The size in bytes of the contour buffer. | |
[in] | buf | Pixel buffer of the image. |
dim | Row dimension of the pixel buffer. | |
width | Image width in pixels. | |
height | Image height in pixels. |
int rapp_contour_8conn_bin | ( | unsigned | origin[2], | |
char *restrict | contour, | |||
int | len, | |||
const uint8_t *restrict | buf, | |||
int | dim, | |||
int | width, | |||
int | height | |||
) |
8-connectivity contour chain code.
[out] | origin | An array where to store the start position of the contour. It must have at least two elements. |
[out] | contour | Chain code contour buffer. May be NULL iff len is 0. |
len | The size in bytes of the contour buffer. | |
[in] | buf | Pixel buffer of the image. |
dim | Row dimension of the pixel buffer. | |
width | Image width in pixels. | |
height | Image height in pixels. |