Enum BinarizationMethod
Enum BinarizationMethod
Navne til: Aspose.Note.Saving Sammensætning: Aspose.Note.dll (25.4.0)
Det angiver binariseringsmetoden for et billede.
public enum BinarizationMethod
Fields
FixedThreshold = 0
Billedets binarisering udføres ved hjælp af specifikke faste grænser.
Otsu = 1
Billedets binarisering udføres adaptivt ved hjælp af Otsu’s metode til evaluering af træk.
Examples
Se, hvordan man gemmer et dokument som et binært billede ved hjælp af Otsus metode.
// 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,
}
});
Se, hvordan man gemmer et dokument som et binært billede ved hjælp af en fast grænse.
// 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
}
});