5.3.4.31. Function CCL_threshold_features_apply
Defined in File CCL_compute.h
5.3.4.31.1. Function Documentation
-
uint32_t CCL_threshold_features_apply(CCL_gen_data_t *CCL_data, const uint8_t **img, uint32_t **labels, const uint8_t threshold, RoI_basic_t *RoIs_basic, const size_t max_RoIs_size, const uint8_t no_init_labels)
First select pixels according to a threshold, then compute a Connected-Components Labeling algorithm and finally extract basic features. Note: this is optimized to be faster than to compute the thresholding, to perform the CCL and to extract the features separately. Note2: if the returned number of labels is higher than the
*RoIs_basic->_max_sizevalue, then the features are not filled. Generic CCL implementation.- Parameters
CCL_data – Inner data required to perform the CCL.
img – Input grayscale image (2D array \([i1 - i0 + 1][j1 - j0 + 1]\), grayscale is in \([0;255]\) range).
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).
threshold – Value (between \([0;255]\)). If the pixel intensity is higher than
threshold, then the pixel is kept for the labeling, else the pixel is ignored.RoIs_basic – Basic features.
max_RoIs_size – Maximum capacity of the
RoIs_basicarray.no_init_labels – If this boolean is set to
1, then thelabelsbuffer is considered pre-initialized with0values. Else, ifno_labels_initparameter is set to0, then this function will initialized zones that does not correspond to connected-components with0value. In doubt, prefer to setno_labels_initparameter to0.
- Returns
Number of labels.