←Select platform

BinaryFilterCommand Constructor(BinaryFilterCommandPredefined)

Summary
Initializes a new BinaryFilterCommand class object with a predefined binary filter.
Syntax
C#
Objective-C
C++/CLI
Java
Python
- (instancetype)initWithPredefinedBinaryFilter:(LTBinaryFilterCommandPredefined)predefined NS_DESIGNATED_INITIALIZER; 
public BinaryFilterCommand( 
   BinaryFilterCommandPredefined predefined 
); 
public: 
BinaryFilterCommand(  
   BinaryFilterCommandPredefined predefined 
) 
__init__(self,predefined) # Overloaded constructor 

Parameters

predefined
A BinaryFilterCommandPredefined enumeration value that specifies which predefined binary filter to use.

Remarks

The BinaryFilterCommandPredefined filters shrink or erode black objects in specific directions.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Effects; 
 
 
public void BinaryFilterCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "ImageProcessingDemo\\Image1.jpg")); 
 
   // Prepare the command 
   BinaryFilterCommand command = new BinaryFilterCommand(BinaryFilterCommandPredefined.DilationOmniDirectional); 
   //Dilate black objects. 
   command.Run(image); 
   codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24); 
 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

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

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