BinarizeOtsu

DicomImage.BinarizeOtsu method

Binarization of an image with Otsu thresholding

public override void BinarizeOtsu()

Examples

The following example binarizes a DICOM 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.dicom"))
{
    Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;

    // Binarize the image with Otsu thresholding.
    dicomImage.BinarizeOtsu();
    dicomImage.Save(dir + "sample.BinarizeOtsu.png", new Aspose.Imaging.ImageOptions.PngOptions());
}

See Also