5.3.4.55. Function features_merge_CCL_HI_v2

5.3.4.55.1. Function Documentation

uint32_t features_merge_CCL_HI_v2(const uint32_t **in_labels, const uint8_t **img_HI, uint32_t **out_labels, const int i0, const int i1, const int j0, const int j1, RoI_basic_t *RoIs_basic, const size_t n_RoIs, const uint32_t S_min, const uint32_t S_max)

Hysteresis re-labeling and morphological thresholding. From a 2D array of labels (in_label) and a binary image (img_HI), the function generates a new 2D array of labels (out_labels). The newly produced labels (out_labels) are a sub-set of the “old” labels (in_labels). Labels from in_labels are kept in out_labels only if at least one pixel of the current connected-component exists in the binary image (img_HI). Finally, this function performs a morphological thresholding as follow: if \( S_{min} > S \) or \( S > S_{max}\) then the corresponding RoIs_id is set to 0.

See also

RoI_basic_t for more explanations about the features.

Parameters
  • in_labels – Input 2D array of labels ( \([i1 - i0 + 1][j1 - j0 + 1]\)).

  • img_HI – Binary image (2D array \([i1 - i0 + 1][j1 - j0 + 1]\) \(\{0,1\}\) has to be coded as \(\{0,255\}\)). This image results from a threshold filter on the original image. This threshold filter should be higher than the first one used to compute the initial labels (in_labels).

  • out_labels – Output 2D array of labels ( \([i1 - i0 + 1][j1 - j0 + 1]\)).

  • i0 – First \(y\) index in the labels (included).

  • i1 – Last \(y\) index in the labels (included).

  • j0 – First \(x\) index in the labels (included).

  • j1 – Last \(x\) index in the labels (included).

  • RoIs_basic – Features.

  • n_RoIs – Number of connected-components (= number of RoIs) in the 2D array of in_labels.

  • S_min – Minimum morphological threshold.

  • S_max – Maximum morphological threshold.

Returns

Number of labels.