Skip to content

gapi_equalizeHist

gapifunctionOpenCV 5.0.0
import { gapi_equalizeHist } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSsrc
FUNCTIONgapi_equalizeHist
RETURN TYPEGMat
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Equalizes the histogram of a grayscale image.

//! gapi_feature

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

  • Calculate the histogram H for src .
  • Normalize the histogram so that the sum of histogram bins is 255.
  • Compute the integral of the histogram:
H'_i =  \sum _{0  \le j < i} H(j)
  • Transform the image using H' as a look-up table: \texttt{dst}(x,y) = H'(\texttt{src}(x,y))

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

Note: - The returned image is of the same size and type as input.

  • Function textual ID is "org.opencv.imgproc.equalizeHist"
gapi_equalizeHist(src: GMat): GMat;
src

Source 8-bit single channel image.

Returns

The GMat result. Release returned native handles with using or delete(), including handles nested in results.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.