VintaSoft Imaging .NET SDK 15.2: Документация для .NET разработчика
Vintasoft.Imaging.FormsProcessing.TemplateMatching Namespace / KeyLineRecognizerCommand Class
Члены типа Объект Синтаксис Example Иерархия Требования Смотрите также
В этом разделе
Класс KeyLineRecognizerCommand
В этом разделе
Распознает зоны ключа на основе линий на изображении.
Объектная модель
ProcessingCommandBase RegionOfInterest ProcessingCommandResults KeyLineRecognizerCommand
Синтаксис
'Declaration

Public Class KeyLineRecognizerCommand
   Inherits KeyZoneRecognizerCommand

public class KeyLineRecognizerCommand : KeyZoneRecognizerCommand

Пример

Вот C#/VB.NET код, который демонстрирует, как идентифицировать изображение документа с помощью алгоритма, который создает отпечаток изображения на основе линий.


''' <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;
}

Иерархия наследования

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

Требования

Целевые платформы: .NET 11; .NET 10; .NET 9; .NET 8; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

Смотрите также