| Bsoft 1.9 Bernard's software package

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Functions | Variables
img_histogram.cpp File Reference

Library routines used for images. More...

`#include "rwimg.h"`
`#include "img_histogram.h"`
`#include "simplex.h"`
`#include "cluster.h"`
`#include "qsort_functions.h"`
`#include "math_util.h"`
`#include "utilities.h"`

Go to the source code of this file.

## Functions
double | img_fit_gauss_to_his_R (Bsimplex *simp)
double | img_fit_poisson_to_his_R (Bsimplex *simp)
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...

## Variables
int | verbose

## Detailed Description

Library routines used for images.

Author
  Bernard Heymann

Date
  Created: 19990321
  Modified: 20150618

Definition in file img_histogram.cpp.

## Function Documentation

double img_fit_gauss_to_his_R | ( | Bsimplex * | simp | ) |

Definition at line 535 of file img_histogram.cpp.

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

Fits a gaussian function to a histogram of an image.

Parameters

  *p | image (not altered).
  bins | number of bins in the histogram.
  n | number 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.

double img_fit_poisson_to_his_R | ( | Bsimplex * | simp | ) |

Definition at line 554 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

  *p | image (not altered).
  bins | number 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

  *p | image (not altered).
  bins | number 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

  *p | image (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.

## Variable Documentation

int verbose