←Select platform

AutoBinarizeCommand Constructor(int,AutoBinarizeCommandFlags)

Summary
Initializes a new AutoBinarizeCommand class object with explicit parameters.
Syntax
C#
Objective-C
C++/CLI
Java
Python
- (instancetype)initWithFactor:(NSUInteger)factor flags:(LTAutoBinarizeCommandFlags)flags NS_DESIGNATED_INITIALIZER; 
public AutoBinarizeCommand( 
   int factor,  
   int flags 
) 
public: 
AutoBinarizeCommand(  
   int factor, 
   AutoBinarizeCommandFlags flags 
) 
__init__(self,factor,flags) # Overloaded constructor 

Parameters

factor
The meaning of this factor depends on which threshold type flags are being used.

flags
Flags that determine the behavior of Auto Binarize process.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Core; 
 
public void AutoBinarizeCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "noisy_barcode.jpg")); 
 
   AutoBinarizeCommand command = new AutoBinarizeCommand(); 
   command.Flags = AutoBinarizeCommandFlags.UsePercentileThreshold | AutoBinarizeCommandFlags.DontUsePreProcessing; 
   command.Factor = 2000; // use 20% threshold 
   command.Run(image); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.11.1
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.Core Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.