VintaSoft Imaging .NET SDK 15.1: Documentation for .NET developer
Vintasoft.Imaging.FormsProcessing.TemplateMatching Namespace / KeyLineRecognizerCommand Class
Members Object Syntax Example Hierarchy Requirements SeeAlso
In This Topic
KeyLineRecognizerCommand Class
In This Topic
Recognizes key zones, based on lines, on an image.
Object Model
ProcessingCommandBase RegionOfInterest ProcessingCommandResults KeyLineRecognizerCommand
Syntax
'Declaration

Public Class KeyLineRecognizerCommand
   Inherits KeyZoneRecognizerCommand

public class KeyLineRecognizerCommand : KeyZoneRecognizerCommand

Example

This C#/VB.NET code shows how to identify a document image using algorithm that creates an image imprint based on lines.


''' <summary>
''' Identifies the image using key lines.
''' </summary>
''' <param name="templateImages">The template images.</param>
''' <param name="testImage">The test image.</param>
''' <returns>Result of template matching.</returns>
Public Shared Function IdentifyUsingLines(templateImages As Vintasoft.Imaging.VintasoftImage(), testImage As Vintasoft.Imaging.VintasoftImage) As Vintasoft.Imaging.FormsProcessing.TemplateMatching.TemplateMatchingResult
    ' create a recognizer
    Dim lineRecognizerCommand As New Vintasoft.Imaging.FormsProcessing.TemplateMatching.KeyLineRecognizerCommand()
    ' set units of measure
    lineRecognizerCommand.UnitOfMeasure = Vintasoft.Imaging.UnitOfMeasure.Pixels
    ' set max length of line
    lineRecognizerCommand.MaxLength = 2000
    ' create a template matching command
    Dim templateMatchingCommand As New Vintasoft.Imaging.FormsProcessing.TemplateMatching.TemplateMatchingCommand()
    ' set imprint generator based on recognizer
    templateMatchingCommand.ImageImprintGenerator = New Vintasoft.Imaging.FormsProcessing.TemplateMatching.ImageImprintGeneratorCommand(lineRecognizerCommand)
    ' add template images
    templateMatchingCommand.TemplateImages.AddRange(templateImages)
    ' execute template matching
    templateMatchingCommand.ExecuteInPlace(testImage)
    ' return result
    Return templateMatchingCommand.Result
End Function


/// <summary>
/// Identifies the image using key lines.
/// </summary>
/// <param name="templateImages">The template images.</param>
/// <param name="testImage">The test image.</param>
/// <returns>Result of template matching.</returns>
public static Vintasoft.Imaging.FormsProcessing.TemplateMatching.TemplateMatchingResult IdentifyUsingLines(
    Vintasoft.Imaging.VintasoftImage[] templateImages, 
    Vintasoft.Imaging.VintasoftImage testImage)
{
    // create a recognizer
    Vintasoft.Imaging.FormsProcessing.TemplateMatching.KeyLineRecognizerCommand lineRecognizerCommand = 
        new Vintasoft.Imaging.FormsProcessing.TemplateMatching.KeyLineRecognizerCommand();
    // set units of measure
    lineRecognizerCommand.UnitOfMeasure = Vintasoft.Imaging.UnitOfMeasure.Pixels;
    // set max length of line
    lineRecognizerCommand.MaxLength = 2000;
    // create a template matching command
    Vintasoft.Imaging.FormsProcessing.TemplateMatching.TemplateMatchingCommand templateMatchingCommand = 
        new Vintasoft.Imaging.FormsProcessing.TemplateMatching.TemplateMatchingCommand();
    // set imprint generator based on recognizer
    templateMatchingCommand.ImageImprintGenerator =
        new Vintasoft.Imaging.FormsProcessing.TemplateMatching.ImageImprintGeneratorCommand(lineRecognizerCommand);
    // add template images
    templateMatchingCommand.TemplateImages.AddRange(templateImages);
    // execute template matching
    templateMatchingCommand.ExecuteInPlace(testImage);
    // return result
    return templateMatchingCommand.Result;
}

Inheritance Hierarchy

System.Object
   Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
      Vintasoft.Imaging.ImageProcessing.ProcessingCommandWithRegion
         Vintasoft.Imaging.FormsProcessing.TemplateMatching.KeyZoneRecognizerCommand
            Vintasoft.Imaging.FormsProcessing.TemplateMatching.KeyLineRecognizerCommand

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