DetectGlareCommand Class
Summary
Detects the glare zone in an image.
Syntax
C#
VB
Objective-C
C++
Java
public class DetectGlareCommand : RasterCommand, IInformationCommand
@interface LTKernelDetectGlareCommand : LTRasterCommand
public class DetectGlareCommand extends RasterCommand
Example
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Kernel;
public void DetectGlareCommandExample()
{
using (RasterCodecs codecs = new RasterCodecs())
{
// Load an image
using (RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Glare.jpg")))
{
// Detect glare zone
DetectGlareCommand command = new DetectGlareCommand();
command.Run(image);
if (command.GlareArea.IsEmpty)
Console.WriteLine("No glare detected");
else
Console.WriteLine("Glare detected");
}
}
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS21\Resources\Images";
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Kernel
Public Sub DetectGlareCommandExample()
Using codecs As RasterCodecs = New RasterCodecs()
Using image As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Glare.jpg"))
' Detect glare zone
Dim command As DetectGlareCommand = New DetectGlareCommand()
command.Run(image)
If command.GlareArea.IsEmpty Then
Console.WriteLine("No glare detected")
Else
Console.WriteLine("Glare detected")
End If
End Using
End Using
End Sub
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\LEADTOOLS21\Resources\Images"
End Class