Class ImageBinarizationOptions
Contents
[
Hide
]ImageBinarizationOptions class
Options for image’s binarization.
public class ImageBinarizationOptions
Constructors
Name | Description |
---|---|
ImageBinarizationOptions() | The default constructor. |
Properties
Name | Description |
---|---|
BinarizationMethod { get; set; } | Gets or sets the binarization method. The default value is FixedThreshold. |
BinarizationThreshold { get; set; } | Gets or sets threshold value for fixed threshold binarization method. The default value is 128. |
Examples
Shows how to save a document as binary image using Otsu’s method.
// 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,
}
});
Shows how to save a document as binary image using fixed threshold.
// 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
}
});
See Also
- namespace Aspose.Note.Saving
- assembly Aspose.Note