Enum BinarizationMethod
Enum BinarizationMethod
Названий на: Aspose.Note.Saving Асамблея: Aspose.Note.dll (25.4.0)
Визначає метод бінарності для зображення.
public enum BinarizationMethod
Fields
FixedThreshold = 0
Бінарність зображення здійснюється за допомогою визначеного фіксованого прага.
Otsu = 1
Бінарність зображення здійснюється адаптивно за допомогою методу Otsu для оцінки межі.
Examples
Показує, як зберегти документ як бінарний зображення за допомогою методу 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,
}
});
Показує, як зберегти документ як бінарний зображення за допомогою фіксованого прага.
// 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
}
});