5.3.4.3. Function _features_extract

5.3.4.3.1. Function Documentation

void _features_extract(const uint32_t **labels, const int i0, const int i1, const int j0, const int j1, uint32_t *RoIs_id, uint32_t *RoIs_xmin, uint32_t *RoIs_xmax, uint32_t *RoIs_ymin, uint32_t *RoIs_ymax, uint32_t *RoIs_S, uint32_t *RoIs_Sx, uint32_t *RoIs_Sy, float *RoIs_x, float *RoIs_y, const size_t n_RoIs)

Basic features extraction from a 2D array of labels. In other words, this function converts a (sparse ?) 2-dimensional representation of connected-components (CCs) into a list of CCs.

See also

RoIs_basic_t for more explanations about the features.

Parameters
  • labels – 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_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.

  • RoIs_Sx – Array of sums of \(x\) properties.

  • RoIs_Sy – Array of sums of \(y\) properties.

  • RoIs_x – Array of centroids abscissa.

  • RoIs_y – Array of centroids ordinate.

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