IM: Image Statistics Calculations

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 *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 *image, unsigned long *histo, int cumulative)
void imCalcImageStatistics (const imImage *image, imStats *stats)
void imCalcHistogramStatistics (const imImage *image, imStats *stats)
void imCalcHistoImageStatistics (const imImage *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 two images (Root Mean Square Error).

im.CalcRMSError(image1: imImage, image2: imImage) -> rms: number [in Lua 5] 

float imCalcSNR const imImage src_image,
const imImage noise_image
 

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

im.CalcSNR(src_image: imImage, noise_image: imImage) -> snr: number [in Lua 5] 

unsigned long imCalcCountColors const imImage image  ) 
 

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

im.CalcCountColors(image: imImage) -> count: number [in Lua 5] 

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.

im.CalcHistogram(image: imImage, plane: number, cumulative: number) -> histo: table of numbers [in Lua 5] 
Where plane is the depth plane to calculate the histogram.
The returned table is zero indexed. image can be IM_USHORT or IM_BYTE.

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.
Use imCalcHistogram in Lua.

void imCalcGrayHistogram const imImage 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.

im.CalcGrayHistogram(image: imImage, cumulative: number) -> histo: table of numbers [in Lua 5] 

void imCalcImageStatistics const imImage 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_CFLOAT.

im.CalcImageStatistics(image: imImage) -> stats: table [in Lua 5] 
Table contains the following fields: max, min, positive, negative, zeros, mean, stddev. The same as the imStats structure.

void imCalcHistogramStatistics const imImage 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.

im.CalcHistogramStatistics(image: imImage) -> stats: table [in Lua 5] 

void imCalcHistoImageStatistics const imImage 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.

im.CalcHistoImageStatistics(image: imImage) -> median: number, mode: number [in Lua 5]