Leaper Vision Toolkit
中文 / English 2.x
Public Member Functions
ILImageStats Interface Reference

This interface provide functionalities of statistics operations. More...

Inheritance diagram for ILImageStats:
ILObject LImageStats

Public Member Functions

void CountPixel (ILImage *img, ILRegion *region, int lb, int ub, int *belowCount, int *betweenCount, int *aboveCount)
 
void CountPixelColor (ILImage *img, ILRegion *region, LColor lb, struct LColor ub, int *betweenCount, int *outsideCount)
 
void Max (ILImage *img, ILRegion *region, int *value, int *posX, int *posY)
 
void MeanStdDev (ILImage *img, ILRegion *region, double *meanValue, double *stdDevValue)
 
void Min (ILImage *img, ILRegion *region, int *value, int *posX, int *posY)
 
double Sharpness (ILImage *img, ILRegion *region)
 
- Public Member Functions inherited from ILObject
ILObjectCopy ()
 
LPVErrorCode Load (LString filename)
 
void Reset ()
 
LPVErrorCode Save (LString filename)
 
BOOL Valid ()
 

Detailed Description

This interface provide functionalities of statistics operations.

To use this interface, you should create a LImageStats object.

Example Code

Member Function Documentation

◆ CountPixel()

void CountPixel ( ILImage img,
ILRegion region,
int  lb,
int  ub,
int *  belowCount,
int *  betweenCount,
int *  aboveCount 
)

Count the pixels in the input image which is below, between or above the given threshold bounds.

Parameters
[in]img The input image.
[in]regionInput region. It's optional, could be null.
[in]lbThe lower bound of threshold range, in range of 0 ~ 255 for 8bit images, 0 ~ 65535 for 16bit images
[in]ubThe upper bound of threshold range, in range of 0 ~ 255 for 8bit images, 0 ~ 65535 for 16bit images
[out]belowCountReturn the count of pixels below the lower bound of threshold range.
[out]betweenCountReturn the count of pixels in the threshold range.
[out]aboveCountReturn the count of pixels above the upper bound of threshold range.

◆ CountPixelColor()

void CountPixelColor ( ILImage img,
ILRegion region,
LColor  lb,
struct LColor  ub,
int *  betweenCount,
int *  outsideCount 
)

Count the pixels in the input image which is between or outside the given color bounds.
For all of the channels, the pixel value is within the color bounds, then it's a "between" color pixel. Otherwise, for any of the channel, the pixel value is smaller or greater than the lower/upper bound, then it's a "outside" color pixel.

Parameters
[in]img The input image.
[in]regionInput region. It's optional, could be null.
[in]lbThe lower bound of color range, each channel should be smaller then or equal to the upper bound.
[in]ubThe upper bound of color range, each channel should be bigger then or equal to the lower bound.
[out]betweenCountReturn the count of pixels within the bounds.
[out]outsideCountReturn the count of pixels out of the bounds.

◆ Max()

void Max ( ILImage img,
ILRegion region,
int *  value,
int *  posX,
int *  posY 
)

Find the pixel of maximum value in the input image, report the value and pixel's position. If there's more than one pixel with the same value, report the left-top one.

Parameters
[in]img The input image.
[in]regionInput region. It's optional, could be null.
[out]valueReturn the maximum value.
[out]posXReturn the x-coordinate of the pixel's position with maximum value.
[out]posYReturn the y-coordinate of the pixel's position with maximum value.

◆ MeanStdDev()

void MeanStdDev ( ILImage img,
ILRegion region,
double *  meanValue,
double *  stdDevValue 
)

Calculate the mean and standard deviation of the input image.

Parameters
[in]img The input image.
[in]regionInput region. It's optional, could be null.
[out]meanValueReturn the mean value.
[out]stdDevValueReturn the standard deviation value.

◆ Min()

void Min ( ILImage img,
ILRegion region,
int *  value,
int *  posX,
int *  posY 
)

Find the pixel of minimum value in the input image, report the value and pixel's position. If there's more than one pixel with the same value, report the left-top one.

Parameters
[in]img The input image.
[in]regionInput region. It's optional, could be null.
[out]valueReturn the minimum value.
[out]posXReturn the x-coordinate of the pixel's position with minimum value.
[out]posYReturn the y-coordinate of the pixel's position with minimum value.

◆ Sharpness()

double Sharpness ( ILImage img,
ILRegion region 
)

Compute the relative sharpness of the input image, based on the edge gradients. It's usually used to automate focusing a camera lens on a scene. Note that the score may be affected by the contrast, brightness and content of the scene, thus it's meaningless to compare the sharpness scores of different scenes.

Parameters
[in]imgThe input image.
[in]regionInput region. It's optional, could be null.
Return values
valueReturn the sharpness score.