PANDORE Version 6 GREYC-IMAGE

phistogramequalization



Performs contrast stretching using histogram equalization.



Synopsis

phistogramequalization min max [-m mask] [im_in|-] [im_out|-]

Description

phistogramequalization performs a gray-levels transformation by forcing the gray-levels to spread over the entire intensity range between min and max. As a consequence, histogram equalization expands gray-levels where information is important and compresses gray-levels where the information is low.
This transform is not likely to work well on input images that have dark gray-levels distribution.

The new output bounds of the output gray-levels are given by the parameter min and max.

The equalization has the form:

  1. Compute the cumulated histogram for im_in;
  2. Normalize histogram between [0..1];
  3. Build output image im_out with for each pixel 'p':
        im_out[p] = HC[im_in[p]]*(max-min);
      

For color and multispectral images, the transform uses the marginal approach: it is applied on each band individually.

Parameters

Inputs

Outputs

Result

Returns SUCCESS or FAILURE in case of invalid parameter values.

Examples

Equalizes histogram with the new bounds [0,255]:

    phistogramequalization 20 200 tangram.pan a.pan

Equalizes histogram with the same bounds than the input image:

    phistogramequalization 0 -1 tangram.pan a.pan

See also

Lut transform, phistogramspecification

C++ prototype

Errc PHistogramEqualization( const Img2duc &im_in, Img2duc &im_out, float min, float max );

Version française

Rehaussement de contraste par égalisation d'histogramme.


Author: Régis Clouard