5.3.4.20. Function CCL_apply

5.3.4.20.1. Function Documentation

uint32_t CCL_apply(CCL_gen_data_t *CCL_data, const uint8_t **img, uint32_t **labels, const uint8_t no_init_labels)

Compute a Connected-Components Labeling algorithm. Generic CCL implementation.

Parameters
  • CCL_data – Inner data required to perform the CCL.

  • img – Input binary image (2D array \([i1 - i0 + 1][j1 - j0 + 1]\), \(\{0,1\}\) has to be coded as \(\{0,255\}\)).

  • labels – Output labels (2D array \([i1 - i0 + 1][j1 - j0 + 1]\). The labels are in \([1;2^{32} -1]\) and 0 value means no label).

  • no_init_labels – If this boolean is set to 1, then the labels buffer is considered pre-initialized with 0 values. Else, if no_labels_init parameter is set to 0, then this function will initialized zones that does not correspond to connected-components with 0 value. In doubt, prefer to set no_labels_init parameter to 0.

Returns

Number of labels.