histo_gauss ( : : Histogramm, Sigma : Smoothed )

Smooth a histogram by averaging with a Gaussian mask.

histo_mean smooths a histogram by convolving it with a Gaussian with parameter Sigma. The histogram contains 256 values.


Parameters

Histogramm (input_control)
histogram.values-array -> integer
Gray value histogram.

Sigma (input_control)
number -> real
Amount of smoothing to be performed.
Default value: 2.0
Suggested values: 0.5, 1.0, 2.0, 3.0, 4.0, 5.0
Range of values: 0.1 <= Sigma <= 50.0 (lin)
Minimum increment: 0.01
Recommended increment: 0.2

Smoothed (output_control)
histogram.values-array -> integer
Smoothed gray value histogram.


Example
#include  
#include  "HCPP.H"

int main (int argc, char *argv[])
{
  HImage   image (argv[1]);
  HWindow  win;

  Tuple    HistoAbs, HistoRel,
           MinThres, MaxThres,
           Sigma = 3.0,
           Smoothed;

  HRegionArray reg = image.GetDomain ();

  HistoAbs = reg.Histo (image, &HistoRel);
  histo_gauss (HistoAbs, Sigma, &Smoothed);

  Sigma = 0.0;
  histo_to_thresh (Smoothed, Sigma, &MinThres, &MaxThres);

  HRegionArray seg = image.Threshold (MinThres, MaxThres);
  HRegionArray con = seg.Connection ();

  con.Display (win);
  win.Click ();

  return (0);
}

Possible Predecessors

histo__


Possible Successors

histo_to_thresh, histo_to_region


Alternatives

histo_mean


See also

auto_threshold1, auto_threshold2



Copyright © 1996-1997 MVTec Software GmbH