Visual Basic (Declaration) | |
---|---|
Public Class AutoBinarizeCommand Inherits Leadtools.ImageProcessing.RasterCommand Implements IRasterCommand |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As AutoBinarizeCommand |
C# | |
---|---|
public class AutoBinarizeCommand : Leadtools.ImageProcessing.RasterCommand, IRasterCommand |
C++/CLI | |
---|---|
public ref class AutoBinarizeCommand : public Leadtools.ImageProcessing.RasterCommand, IRasterCommand |
Runs the AutoBinarizeCommand on an image and converts it to a bitonal image.
Visual Basic | Copy Code |
---|---|
Public Sub AutoBinarizeCommandExample() ' Load an image Dim codecs As RasterCodecs = New RasterCodecs() codecs.ThrowExceptionsOnInvalidImages = True Dim image As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Sample.mrc")) Dim command As AutoBinarizeCommand = New AutoBinarizeCommand() command.Run(image) End Sub Public NotInheritable Class LEAD_VARS Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" End Class |
C# | Copy Code |
---|---|
public void AutoBinarizeCommandExample() { // Load an image RasterCodecs codecs = new RasterCodecs(); codecs.ThrowExceptionsOnInvalidImages = true; RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Sample.mrc")); AutoBinarizeCommand command = new AutoBinarizeCommand(); command.Run(image); } static class LEAD_VARS { public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; } |
SilverlightCSharp | Copy Code |
---|---|
public void AutoBinarizeCommandExample(RasterImage image, Stream outStream) { AutoBinarizeCommand command = new AutoBinarizeCommand(); command.Run(image); // Save result image RasterCodecs codecs = new RasterCodecs(); codecs.Save(image, outStream, RasterImageFormat.Jpeg, 24); image.Dispose(); } |
SilverlightVB | Copy Code |
---|---|
Public Sub AutoBinarizeCommandExample(ByVal image As RasterImage, ByVal outStream As Stream)
Dim command As AutoBinarizeCommand = New AutoBinarizeCommand()
command.Run(image)
' Save result image
Dim codecs As RasterCodecs = New RasterCodecs()
codecs.Save(image, outStream, RasterImageFormat.Jpeg, 24)
image.Dispose()
End Sub |
- 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.
- Automatic pre-processing
- Pre-processing using background elimination
- Pre-processing using color leveling
- Perform automatic, percentile or median threshold
- Manually specify a threshold value
System.Object
Leadtools.ImageProcessing.RasterCommand
Leadtools.ImageProcessing.Core.AutoBinarizeCommand
Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)
Reference
AutoBinarizeCommand MembersLeadtools.ImageProcessing.Core Namespace
Introduction to Image Processing With LEADTOOLS
DeskewCommand Class
Leadtools.ImageProcessing.Color.AutoBinaryCommand
Leadtools.ImageProcessing.Color.DynamicBinaryCommand
BlankPageDetectorCommand Class
DespeckleCommand Class
LineRemoveCommand Class
AutoCropCommand Class
DotRemoveCommand Class
HolePunchRemoveCommand Class
InvertedTextCommand Class