RasterImageBinarizeOtsu Method
Binarization of an image with Otsu thresholding

Namespace: Aspose.Imaging
Assembly: Aspose.Imaging (in Aspose.Imaging.dll) Version: 20.05
Syntax
public virtual void BinarizeOtsu()
Examples
The following example binarizes a raster image with Otsu thresholding. Binarized images contain only 2 colors - black and white.
[C#]

string dir = "c:\\temp\\";

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.png"))
{
    Aspose.Imaging.RasterImage rasterImage = (Aspose.Imaging.RasterImage)image;

    // Binarize the image with Otsu thresholding.
    rasterImage.BinarizeOtsu();
    rasterImage.Save(dir + "sample.BinarizeOtsu.png");
}
See Also