VintaSoft Imaging .NET SDK 15.1: Documentation for .NET developer
Vintasoft.Imaging.FormsProcessing.TemplateMatching Namespace / TemplateAligningCommand Class
Members Object Syntax Example Hierarchy Requirements SeeAlso
In This Topic
TemplateAligningCommand Class
In This Topic
Aligns an image using the comparison result of image and template image.
Object Model
ImageImprintCompareResult ProcessingCommandResults TemplateAligningCommand
Syntax
'Declaration

Public Class TemplateAligningCommand
   Inherits Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase

public class TemplateAligningCommand : Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase

Example

This C#/VB.NET code shows how to identify a document image and align the document image to its template.


''' <summary>
''' Identifies and aligns the image.
''' </summary>
''' <param name="templateImages">The template images.</param>
''' <param name="testImage">The test image.</param>
Public Shared Sub IdentifyAndAlign(templateImages As Vintasoft.Imaging.VintasoftImage(), testImage As Vintasoft.Imaging.VintasoftImage)
    ' create template matching command
    Dim templateMatchingCommand As New Vintasoft.Imaging.FormsProcessing.TemplateMatching.TemplateMatchingCommand()
    ' add template images
    templateMatchingCommand.TemplateImages.AddRange(templateImages)
    ' execute template matching
    templateMatchingCommand.ExecuteInPlace(testImage)
    ' create template aligning command
    Dim templateAligningCommand As New Vintasoft.Imaging.FormsProcessing.TemplateMatching.TemplateAligningCommand()
    ' set matching result
    templateAligningCommand.CompareResult = templateMatchingCommand.Result.ImageCompareResult
    ' execute template aligning
    templateAligningCommand.ExecuteInPlace(testImage)
End Sub


/// <summary>
/// Identifies and aligns the image.
/// </summary>
/// <param name="templateImages">The template images.</param>
/// <param name="testImage">The test image.</param>
public static void IdentifyAndAlign(
    Vintasoft.Imaging.VintasoftImage[] templateImages, 
    Vintasoft.Imaging.VintasoftImage testImage)
{
    // create template matching command
    Vintasoft.Imaging.FormsProcessing.TemplateMatching.TemplateMatchingCommand templateMatchingCommand = 
        new Vintasoft.Imaging.FormsProcessing.TemplateMatching.TemplateMatchingCommand();
    // add template images
    templateMatchingCommand.TemplateImages.AddRange(templateImages);
    // execute template matching
    templateMatchingCommand.ExecuteInPlace(testImage);
    // create template aligning command
    Vintasoft.Imaging.FormsProcessing.TemplateMatching.TemplateAligningCommand templateAligningCommand = 
        new Vintasoft.Imaging.FormsProcessing.TemplateMatching.TemplateAligningCommand();
    // set matching result
    templateAligningCommand.CompareResult = templateMatchingCommand.Result.ImageCompareResult;
    // execute template aligning
    templateAligningCommand.ExecuteInPlace(testImage);
}

Inheritance Hierarchy

System.Object
   Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
      Vintasoft.Imaging.FormsProcessing.TemplateMatching.TemplateAligningCommand

Requirements

Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

See Also