5.3.4.39. Function features_compute_magnitude

5.3.4.39.1. Function Documentation

void features_compute_magnitude(const uint8_t **img, const int i0, const int i1, const int j0, const int j1, const uint32_t **labels, const RoI_basic_t *RoIs_basic, RoI_magn_t *RoIs_magn, const size_t n_RoIs)

Compute magnitude features. The magnitude represents the brightness of a RoI. In a first time, the sum of the pixels intensities is performed. In a second time, the noise level around the connected-component is subtracted to give a better estimation of the real brightness. The magnitude can be defined as follow: \( M = \displaystyle\sum_{p=0} ^{P} i_p - \big((\displaystyle\sum_{n=0} ^{N} i_n) / N\big) \times P\), where \(P\) is the the number of pixels in the current CC, \(i_x\) is the brightness of the pixel \(x\) and \(N\) is the number of noisy pixels considered. In addition, this function can also compute the saturation counter for each RoI (e. g. the number of pixels that have an intensity \(i_x = 255\)).

See also

RoI_basic_t for more explanations about the basic features.

See also

RoI_magn_t for more explanations about the miscellaneous features.

Parameters
  • img – Image in grayscale ( \([i1 - i0 + 1][j1 - j0 + 1]\), the values of the pixel range are \( [ 0;255 ] \)).

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

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

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

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

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

  • RoIs_basic – Basic features.

  • RoIs_magn – Magnitude features (including the magnitudes).

  • n_RoIs – Number of connected-components (= number of RoIs).