SignalToNoiseRatioCommand Class
Summary
Finds the signal to noise ratio (SNR) of an image.
Syntax
C#
VB
Objective-C
C++
Java
public class SignalToNoiseRatioCommand : RasterCommand, IInformationCommand
@interface LTKernelSignalToNoiseRatioCommand : LTRasterCommand
public class SignalToNoiseRatioCommand extends RasterCommand
public ref class SignalToNoiseRatioCommand : public 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")))
{
// SNR value
SignalToNoiseRatioCommand command = new SignalToNoiseRatioCommand();
command.Run(image);
Console.WriteLine(string.Format("SNR: {0}", command.Ratio));
}
}
}
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 DetectDocumentCommandExample()
Using codecs As RasterCodecs = New RasterCodecs()
Using image As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Glare.jpg"))
Dim command As SignalToNoiseRatioCommand = New SignalToNoiseRatioCommand()
command.Run(image)
Console.WriteLine(String.Format("SNR: {0}", command.Ratio))
End Using
End Using
End Sub
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class