Enum BinarizationMethod
Enum BinarizationMethod
Název místa: Aspose.Note.Saving Shromáždění: Aspose.Note.dll (25.4.0)
Definuje metodu binaryzace obrazu.
public enum BinarizationMethod
Fields
FixedThreshold = 0
Binaryzace obrazu se provádí pomocí stanoveného pevného prahu.
Otsu = 1
Binaryzace obrazu se provádí adaptivně pomocí metody Otsu k hodnocení prahu.
Examples
Ukazuje, jak ušetřit dokument jako binární obrázek pomocí metody Otsu.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "Aspose.one");
dataDir = dataDir + "SaveToBinaryImageUsingOtsuMethod_out.png";
// Save the document as gif.
oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
{
ColorMode = ColorMode.BlackAndWhite,
BinarizationOptions = new ImageBinarizationOptions()
{
BinarizationMethod = BinarizationMethod.Otsu,
}
});
Ukazuje, jak ušetřit dokument jako binární obrázek pomocí pevného prahu.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "Aspose.one");
dataDir = dataDir + "SaveToBinaryImageUsingFixedThreshold_out.png";
// Save the document as gif.
oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
{
ColorMode = ColorMode.BlackAndWhite,
BinarizationOptions = new ImageBinarizationOptions()
{
BinarizationMethod = BinarizationMethod.FixedThreshold,
BinarizationThreshold = 123
}
});