5.3.4.4. Function _features_merge_CCL_HI_v2

5.3.4.4.1. Function Documentation

void _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, uint32_t *RoIs_id, const uint32_t *RoIs_xmin, const uint32_t *RoIs_xmax, const uint32_t *RoIs_ymin, const uint32_t *RoIs_ymax, const uint32_t *RoIs_S, 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

RoIs_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]\)). out_labels can be NULL, this way only the features will be updated. out_labels can also be the same pointer as in_labels, this way the output labels will be computed in place.

  • 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_id – Array of RoI unique identifiers.

  • RoIs_xmin – Array of minimum \(x\) coordinates of the bounding box.

  • RoIs_xmax – Array of maximum \(x\) coordinates of the bounding box.

  • RoIs_ymin – Array of minimum \(y\) coordinates of the bounding box.

  • RoIs_ymax – Array of maximum \(y\) coordinates of the bounding box.

  • RoIs_S – Array of RoI surfaces.

  • 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.