←Select platform

DetectGlareCommand Class

Summary

Detects the glare zone in an image.

Syntax
C#
VB
Objective-C
C++
Java
public class DetectGlareCommand : RasterCommand, IInformationCommand 
Public Class DetectGlareCommand  
   Inherits RasterCommand 
@interface LTKernelDetectGlareCommand : LTRasterCommand 
public class DetectGlareCommand extends RasterCommand 
public ref class DetectGlareCommand : public RasterCommand 

Remarks
  • Detects the glare zone in an image.
  • Can be used as a pre-processing step to check image before recognition.
  • This command supports 12- and 16-bit grayscale and 48- and 64-bit color images. Support for 12- and 16-bit grayscale and 48- and 64-bit color images is available only in the Document/Medical toolkits.
  • This command supports unsigned data images, but not signed ones.
  • This command does not support 32-bit grayscale images.
  • This function can only process entire images. It does not support regions.

Note: All RasterCommands in this assembly modify the underlying properties of the input RasterImage, including but not limited to:

  • BitsPerPixel
  • Data
  • IsMirrored

If you wish to avoid RasterImage property fidelity loss, pass a clone of your RasterImage to all RasterCommands in this assembly.

Example
C#
VB
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:\Users\Public\Documents\LEADTOOLS 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:\Users\Public\Documents\LEADTOOLS Images" 
End Class 

Requirements

Target Platforms

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

Leadtools.ImageProcessing.Kernel Assembly