This command compares the correlation image(or part of the correlation image) with all the areas of the same dimensions in the image to be searched (the Run method image) and finds those portions that match according to the measure of correlation. This command is available in the
Document/Medical Toolkits.
Syntax
Example
Run the CorrelationCommand on an image and applies the correlation filter.
Visual Basic | Copy Code |
---|
Public Sub CorrelationCommandExample()
RasterCodecs.Startup()
Dim codecs As New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg")
Dim points() As System.Drawing.Point
ReDim points(89)
Dim DstImage As RasterImage = leadImage.Clone()
Dim command As CorrelationCommand = New CorrelationCommand
command.CorrelationImage = DstImage
command.Threshold = 70
command.XStep = 1
command.YStep = 1
command.Points = points
command.Run(leadImage)
RasterCodecs.Shutdown()
End Sub |
C# | Copy Code |
---|
public void CorrelationCommandExample() { // Load an image RasterCodecs.Startup(); RasterCodecs codecs = new RasterCodecs(); codecs.ThrowExceptionsOnInvalidImages = true; RasterImage image = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg"); // Prepare the command RasterImage DstImage = image.Clone(); CorrelationCommand command = new CorrelationCommand(); command.CorrelationImage = DstImage; command.Threshold = 70; command.XStep = 1; command.YStep = 1; command.Points = new Point[90]; //Apply the correlation filter. command.Run(image); RasterCodecs.Shutdown(); } |
Remarks
Inheritance Hierarchy
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also