Class ImageBinarizationOptions

Class ImageBinarizationOptions

Il nome: Aspose.Note.Saving Assemblea: Aspose.Note.dll (25.4.0)

Opzioni per la binarizzazione dell’immagine.

public class ImageBinarizationOptions

Inheritance

object ImageBinarizationOptions

I membri ereditari

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

Mostra come salvare un documento come immagine binaria utilizzando il metodo di 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,
                                                                                                                              }
                                                                                                    });

Mostra come salvare un documento come immagine binaria utilizzando un limite fisso.

// 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
                                                                                                                                      }
                                                                                                        });

Constructors

ImageBinarizationOptions()

public ImageBinarizationOptions()

Properties

BinarizationMethod

Ottenere o impostare il metodo di binarizzazione.Il valore predefinito è Aspose.Note.Saving.BinarizationMethod.FixedThreshold.

public BinarizationMethod BinarizationMethod { get; set; }

Valore di proprietà

BinarizationMethod

Examples

Mostra come salvare un documento come immagine binaria utilizzando il metodo di 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,
                                                                                                                              }
                                                                                                    });

Mostra come salvare un documento come immagine binaria utilizzando un limite fisso.

// 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
                                                                                                                                      }
                                                                                                        });

BinarizationThreshold

Riceve o impone un valore di soglia per il metodo di binarificazione del limite fisso.Il valore di default è 128.

public byte BinarizationThreshold { get; set; }

Valore di proprietà

byte

Examples

Mostra come salvare un documento come immagine binaria utilizzando un limite fisso.

// 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
                                                                                                                                      }
                                                                                                        });
 Italiano