Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
img_histogram.h File Reference

Header file for image utilities. More...

#include "rwimg.h"
#include "ps_plot.h"

Go to the source code of this file.

Functions

Bplot * img_histogram (Bimage *p, long bins)
 Calculates the histogram of an image. More...
 
Bplot * img_percentiles (Bimage *p)
 Calculates the percentiles from the histogram of an image. More...
 
Bplot * img_fit_gauss_to_histogram (Bimage *p, long bins, long n)
 Fits a gaussian function to a histogram of an image. More...
 
Bplot * img_fit_poisson_to_histogram (Bimage *p, long bins)
 Fits a poisson function to a histogram of an image. More...
 

Detailed Description

Header file for image utilities.

Author
Bernard Heymann
Date
Created: 20000430
Modified: 20150618

Definition in file img_histogram.h.

Function Documentation

Bplot* img_fit_gauss_to_histogram ( Bimage *  p,
long  bins,
long  n 
)

Fits a gaussian function to a histogram of an image.

Parameters
*pimage (not altered).
binsnumber of bins in the histogram.
nnumber of gaussians.
Returns
Bplot* plot of the histogram and the gaussian fit.
A histogram of an image is calculated with a given number of bins.

Definition at line 242 of file img_histogram.cpp.

Bplot* img_fit_poisson_to_histogram ( Bimage *  p,
long  bins 
)

Fits a poisson function to a histogram of an image.

Parameters
*pimage (not altered).
binsnumber of bins in the histogram.
Returns
Bplot* plot of the histogram and the poisson fit.
A histogram of an image is calculated with a given number of bins.
The histogram is fit to the Poisson function:
               lambda * exp(-lambda)
    f(x) = Amp ---------------------
                        x!
by first converting it to a linear form:
    ln(f(x)) = ln(Amp) + x*ln(lambda) - lambda - lgamma(x+1)
and then using the downhill simplex method to find the solution.

Definition at line 414 of file img_histogram.cpp.

Bplot* img_histogram ( Bimage *  p,
long  bins 
)

Calculates the histogram of an image.

Parameters
*pimage (not altered).
binsnumber of bins in the histogram.
Returns
Bplot* 0.
A histogram of an image is calculated with a given number of bins.
Multiple channels are output as successive one-dimensional arrays.
The image data is not affected.
The statistics for the input image must be correctly calculated.
If the postscript file name is given, a postscript plot is produced.

Definition at line 38 of file img_histogram.cpp.

Bplot* img_percentiles ( Bimage *  p)

Calculates the percentiles from the histogram of an image.

Parameters
*pimage (not altered).
Returns
Bplot* plot of the percentiles.
A histogram of an image is calculated with 10000 bins.
The percentiles are calculated from the running sum of the histogram
and returned in a plot.

Definition at line 167 of file img_histogram.cpp.