BinaryFilterCommand Class (original) (raw)

Summary

Imposes a binary filter on an image. This command is available in the Document/Medical Toolkits.

Syntax

C#

Objective-C

C++/CLI

Java

Python

@interface LTBinaryFilterCommand : LTRasterCommand 

public class BinaryFilterCommand extends RasterCommand

class BinaryFilterCommand(RasterCommand): 

Example

Runs the BinaryFilterCommand on an image to dilate black objects.

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"; }