Leadtools.ImageProcessing.Core Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
AutoBinarizeCommand Class
See Also  Members   Example 
Leadtools.ImageProcessing.Core Namespace : AutoBinarizeCommand Class



This function applies binary segmentation to a bitmap automatically.

Syntax

Visual Basic (Declaration) 
Public Class AutoBinarizeCommand 
   Inherits RasterCommand
   Implements IRasterCommand 
Visual Basic (Usage)Copy Code
Dim instance As AutoBinarizeCommand
C# 
public class AutoBinarizeCommand : RasterCommand, IRasterCommand  
C++/CLI 
public ref class AutoBinarizeCommand : public RasterCommand, IRasterCommand  

Example

Runs the AutoBinarizeCommand on an image and converts it to a bitonal image.

Visual BasicCopy Code
Public Sub AutoBinarizeCommandExample()
   ' Load an image
   RasterCodecs.Startup()
   Dim codecs As RasterCodecs = New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim image As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 16\Images\Sample.mrc")

   Dim command As AutoBinarizeCommand = New AutoBinarizeCommand()
   command.Run(image)

   RasterCodecs.Shutdown()
End Sub
C#Copy Code
public void AutoBinarizeCommandExample() 

   // Load an image 
   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 16\Images\Sample.mrc"); 
 
   AutoBinarizeCommand command = new AutoBinarizeCommand(); 
   command.Run(image); 
 
   RasterCodecs.Shutdown(); 
}

Remarks

  • This function is useful for improving recognition results (OCR, Barcode, OMR, ICR).
  • This command does not support 12- or 16-bit grayscale or 48- or 64-bit color images (Exception: Image format not recognized).
  • This command does not support signed data images (Exception: Signed image data not supported).
  • This command does not support 32-bit grayscale images.
Options:
  • Automatic pre-processing
  • Pre-processing using background elimination
  • Pre-processing using color leveling
  • Perform automatic, percentile or median threshold
  • Manually specify a threshold value

Inheritance Hierarchy

System.Object
   Leadtools.ImageProcessing.RasterCommand
      Leadtools.ImageProcessing.Core.AutoBinarizeCommand

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also