IM: Image Statistics Calculations

From IM - An Imaging Tool

Image Statistics Calculations
[Image Processing]


Detailed Description

Operations to calculate some statistics over images.
See im_process_ana.h


Data Structures

struct  _imStats

Typedefs

typedef _imStats imStats

Functions

float imCalcRMSError (const imImage *image1, const imImage *image2)
float imCalcSNR (const imImage *src_image, const imImage *noise_image)
unsigned long imCalcCountColors (const imImage *src_image)
void imCalcHistogram (const unsigned char *data, int count, unsigned long *histo, int cumulative)
void imCalcUShortHistogram (const unsigned short *data, int count, unsigned long *histo, int cumulative)
void imCalcGrayHistogram (const imImage *src_image, unsigned long *histo, int cumulative)
void imCalcImageStatistics (const imImage *src_image, imStats *stats)
void imCalcHistogramStatistics (const imImage *src_image, imStats *stats)
void imCalcHistoImageStatistics (const imImage *src_image, int *median, int *mode)

Typedef Documentation

typedef struct _imStats imStats
 

Numerical Statistics Structure


Function Documentation

float imCalcRMSError (  const imImage *  image1,
const imImage *  image2
) 
 

Calculates the RMS error between 2 images (Root Mean Square Error).

float imCalcSNR (  const imImage *  src_image,
const imImage *  noise_image
) 
 

Calculates the SNR of an image and its noise (Signal Noise Ratio).

unsigned long imCalcCountColors (  const imImage *  src_image  ) 
 

Count the number of different colors in an image.
Image must be IM_BYTE, but all color spaces except IM_CMYK.

void imCalcHistogram (  const unsigned char *  data,
int  count,
unsigned long *  histo,
int  cumulative
) 
 

Calculates the histogram of a IM_BYTE data.
Histogram is always 256 positions long.
When cumulative is different from zero it calculates the cumulative histogram.

void imCalcUShortHistogram (  const unsigned short *  data,
int  count,
unsigned long *  histo,
int  cumulative
) 
 

Calculates the histogram of a IM_USHORT data.
Histogram is always 65535 positions long.
When cumulative is different from zero it calculates the cumulative histogram.

void imCalcGrayHistogram (  const imImage *  src_image,
unsigned long *  histo,
int  cumulative
) 
 

Calculates the gray histogram of an image.
Image must be IM_BYTE/(IM_RGB, IM_GRAY, IM_BINARY or IM_MAP).
If the image is IM_RGB then the histogram of the luma component is calculated.
Histogram is always 256 positions long.
When cumulative is different from zero it calculates the cumulative histogram.

void imCalcImageStatistics (  const imImage *  src_image,
imStats *  stats
) 
 

Calculates the statistics about the image data.
There is one stats for each depth plane. For ex: stats[0]=red stats, stats[0]=green stats, ...
Supports all data types except IM_COMPLEX.

void imCalcHistogramStatistics (  const imImage *  src_image,
imStats *  stats
) 
 

Calculates the statistics about the image histogram data.
There is one stats for each depth plane. For ex: stats[0]=red stats, stats[0]=green stats, ...
Only IM_BYTE images are supported.

void imCalcHistoImageStatistics (  const imImage *  src_image,
int *  median,
int *  mode
) 
 

Calculates some extra statistics about the image histogram data.
There is one stats for each depth plane.
Only IM_BYTE images are supported.
mode will be -1 if more than one max is found.