![]() |
Bsoft 2.1.4
Bernard's software package
|
Library routines to calculate histograms for images. More...
#include "histogram.h"
#include "ps_plot.h"
#include "cluster.h"
#include "moving_average.h"
#include "matrix_linear.h"
#include "qsort_functions.h"
#include "string_util.h"
#include "utilities.h"
Functions | |
vector< long > | histogram (vector< double > data, long bins, double &scale, double &offset) |
Calculates the histogram froma data array. More... | |
Bplot * | plot_convert_to_histogram (Bplot *plot, long bins, long hiscol) |
double | find_maximum_sigma (Matrix &H, long i, long level, long depth, double sum, double &maxsum, vector< double > &t) |
vector< double > | histogram_thresholds (vector< long > h, long number) |
Calculates multiple thresholds from a histogram. More... | |
double | histogram_gaussian_R (Bsimplex &simp) |
vector< double > | plot_histogram_fit_gaussian (Bplot *plot, long ngauss) |
Fits a gaussian function to a histogram of an image. More... | |
int | plot_histogram_fit (Bplot *plot, long ngauss) |
Fits a gaussian function to a histogram and plots it. More... | |
Variables | |
int | verbose |
Library routines to calculate histograms for images.
double find_maximum_sigma | ( | Matrix & | H, |
long | i, | ||
long | level, | ||
long | depth, | ||
double | sum, | ||
double & | maxsum, | ||
vector< double > & | t | ||
) |
vector< long > histogram | ( | vector< double > | data, |
long | bins, | ||
double & | scale, | ||
double & | offset | ||
) |
Calculates the histogram froma data array.
data | vector of data. |
bins | number of bins in the histogram. |
&scale | scale. |
&offset | offset. |
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.
double histogram_gaussian_R | ( | Bsimplex & | simp | ) |
vector< double > histogram_thresholds | ( | vector< long > | h, |
long | number | ||
) |
Calculates multiple thresholds from a histogram.
h | histogram. |
number | number of clusters (one more than thresholds). |
Reference: PS.Liao, TS.Chen, and PC. Chung, Journal of Information Science and Engineering, vol 17, 713-727 (2001)
int plot_histogram_fit | ( | Bplot * | plot, |
long | ngauss | ||
) |
Fits a gaussian function to a histogram and plots it.
plot | histogram plot. |
ngauss | number of gaussians. |
One or more gaussians are fit to a histogram plot. The gaussian curves are added to columns.
vector< double > plot_histogram_fit_gaussian | ( | Bplot * | plot, |
long | ngauss | ||
) |
Fits a gaussian function to a histogram of an image.
plot | plot with histogram. |
ngauss | number of gaussians. |
The return has (in order) the amplitude, offset, and sigma value for each gaussian. The last value is the RMSD, scaled as: RMSD*bins/sum
|
extern |