VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging.FormsProcessing.TemplateMatching Namespace / TemplateAligningCommand Class
Members Example



In This Topic
    TemplateAligningCommand Class
    In This Topic
    Aligns an image using the comparison result of image and template image.
    Object Model
    TemplateAligningCommand ClassImageImprintCompareResult ClassProcessingCommandResults ClassProcessingCommandResult Class
    Syntax
    'Declaration
     
    Public Class TemplateAligningCommand 
       Inherits Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
    public class TemplateAligningCommand : Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase 
    public __gc class TemplateAligningCommand : public Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase 
    public ref class TemplateAligningCommand : public Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase 
    Example
    This example 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: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also