GetHistogramGray example for C++Builder
/*This example gets a histogram for a 12-bit or 16-bit grayscale image and then
displays the number of occurrences of the brightest and darkest intensities*/
int nRet;
ShowMessage ("Table size before call to GetHistogramGray: " + IntToStr(LEADImage1->HistogramGrayTableSize)) ;
nRet= LEADImage1->GetHistogramGray ( ) ;
if ( nRet == SUCCESS )
{
LEADImage1->GetMinMaxVal ( ) ;
ShowMessage ("Highest Intensity: " + IntToStr(LEADImage1->MaxVal) + " Count: " + IntToStr(LEADImage1->HistogramGrayTable[LEADImage1->MaxVal])
+ "\nLowest Intensity: " + IntToStr(LEADImage1->MinVal) + " Count: " + IntToStr(LEADImage1->HistogramGrayTable[LEADImage1->MinVal]));
}
ShowMessage ( "Table size of current histogram: " + IntToStr(LEADImage1->HistogramGrayTableSize));