ImgHistoValue

Top  Previous  Next

Prototype

 

intValue:=ImgHistoValue(intHistoHandle, intLevel)

 

Description

 

Retrieve the value of histogram for a specified level.

 

Parameters

 

intHistoHandle: integer value corresponding to the histogram handle obtained using ImgHistoCreate.

intLevel: integer value, in range 0 - 255, corresponding to the bin to use

 

Returned value

 

Integer value representing the count of pixel into the histogram at specified index.

 

Notes

 

In bin [0] is reported the black pixel and in bin [255] white pixel. In grayscale or color image the histogram represent the pixel brightness.

 

Example

 

// Show the number of pixels for each gray level

HistoHandle:=ImgHistoCreate(_CurrentImage);

 

for Level:=0 to 255 do

begin

 PixelCount:=ImgHistoValue(HistoHandle,Level);

 ApplicationLog('The graylevel ' + IntToStr(Level) + ' counts '+ IntToStr(PixelCount)+ ' pixels.');

end;

 

ImgHistoDelete(HistoHandle);