PANDORE Version 6 GREYC-IMAGE

phistogramspecification



Performs contrast stretching using histogram specification.



Synopsis

phistogramspecification [-m mask] [im_in1|-] [im_in2|-] [im_out|-]

Description

phistogramspecification performs a gray-levels transformation of the input image im_in1 by using a particular histogram shape given by the reference image im_in2.

This operator is useful to enhance a list of images of the same scene. The first step is to enhance histogram of one of the image using particular techniques, and the other step is to apply the same histogram to the remainder images of the list.

The histogram specification is based on the following algorithm:

  1. compute normalized cumulated histogram hc1 of input image im_in1;
  2. compute normalized cumulated histogram hc2 of the reference image im_in2;
  3. for each pixel 'p' of the input image:
    1. s=hc1[im_in1[p]];
    2. Search for i such as hc2[i]=s;
    3. im_out[p]=i.

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

Inputs

Outputs

Result

Returns SUCCESS or FAILURE in case of incompatible input images.

Examples

Applies the histogram transform to tangram.pan from a reference image built with a logarithmic transform of tangram.pan.

   plogtransform 0 0 255 tangram.pan reference.pan
   phistogramspecification tangram.pan reference.pan a.pan

See also

Lut transform, phistogramequalization

C++ prototype

Errc PHistogramSpecification( const Img2duc &im_in1, const Img2duc &im_in2, Img2duc &im_out );

Version française

Rehaussement de contraste par spécification d'histogramme.


Author: Régis Clouard