public CalculateThreshold ( |
||
image | Image to calculate binarization threshold for. | |
rect | Rectangle to calculate binarization threshold for. | |
Résultat | int |
public int CalculateThreshold( Bitmap image, Rectangle rect )
{
int calculatedThreshold = 0;
// lock source bitmap data
BitmapData data = image.LockBits(
new Rectangle( 0, 0, image.Width, image.Height ),
ImageLockMode.ReadOnly, image.PixelFormat );
try
{
calculatedThreshold = CalculateThreshold( data, rect );
}
finally
{
// unlock image
image.UnlockBits( data );
}
return calculatedThreshold;
}
IterativeThreshold::CalculateThreshold ( |
|
IterativeThreshold::CalculateThreshold ( UnmanagedImage image, |