DirectionEdgeStatisticalCommand Class (original) (raw)
Summary
Detects the variation of colors in the specified direction using statistical indices. It is similar to EdgeDetectStatisticalCommand, but this command allows you to specify the direction angle.
Syntax
C#
Objective-C
C++/CLI
Java
Python
@interface LTDirectionEdgeStatisticalCommand : LTRasterCommand
public class DirectionEdgeStatisticalCommand
extends RasterCommand
public ref class DirectionEdgeStatisticalCommand : public RasterCommand
class DirectionEdgeStatisticalCommand(RasterCommand):
Example
Run the DirectionEdgeStatisticalCommand on an image, to find it is edges.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Effects;
public void DirectionEdgeStatisticalCommandExample()
{
// Load an image
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "ImageProcessingDemo\\NaturalFruits.jpg"));
// Prepare the command
DirectionEdgeStatisticalCommand command = new DirectionEdgeStatisticalCommand();
command.Dimension = 15;
command.Threshold = 128;
command.Angle = 4500;
command.EdgeColor = new RasterColor(255, 255, 255);
command.BackGroundColor = new RasterColor(0, 0, 0);
//Find the edges in the image.
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";
}