TemplateAligningCommand Class
Aligns an image using the comparison result of image and template image.
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);
}
System.Object
 Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
   Vintasoft.Imaging.FormsProcessing.TemplateMatching.TemplateAligningCommand
Target Platforms: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5