Function equalize_hist

Source
pub fn equalize_hist(
    src: &impl ToInputArray,
    dst: &mut impl ToOutputArray,
) -> Result<()>
Expand description

Equalizes the histogram of a grayscale image.

The function equalizes the histogram of the input image using the following algorithm:

  • Calculate the histogram inline formula for src .
  • Normalize the histogram so that the sum of histogram bins is 255.
  • Compute the integral of the histogram: block formula
  • Transform the image using inline formula as a look-up table: inline formula

The algorithm normalizes the brightness and increases the contrast of the image.

ยงParameters

  • src: Source 8-bit single channel image.
  • dst: Destination image of the same size and type as src .