Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# DocumentDetector.detectDocumentByName Method

Module: DocumentDetector

## Definition

Detects a document with specified name on a delimited area of the specified DocumentImage and returns a DetectedDocument.

Important

The relevant document template must be loaded before calling this method.

Python

    detect_document_by_name(self, image: DocumentImage, document_name: str, detection_zone: Rectangle) -> DetectedDocument

Parameters

> `image` DocumentImage
> in The source image to process.
> `document_name` str
> in The name of the document to be searched for. Must be a key loaded in DocumentLibrary.
> `detection_zone` Rectangle
> in A delimited area in the image where to search for the document. Default is the full image. Output corners are in the full image referential.

Returns

> DetectedDocument
> Detected document in the image

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Dart

    DetectedDocument detectDocumentByName(DocumentImage image, String? documentName, Rectangle detectionZone)

Parameters

> `image` DocumentImage
> in The source image to process.
> `documentName` String
> in The name of the document to be searched for. Must be a key loaded in DocumentLibrary.
> `detectionZone` Rectangle
> in A delimited area in the image where to search for the document. Default is the full image. Output corners are in the full image referential.

Returns

> DetectedDocument
> Detected document in the image

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

C#

    public DetectedDocument DetectDocumentByName(DocumentImage image, string documentName, Rectangle detectionZone)

Parameters

> `image` DocumentImage
> in The source image to process.
> `documentName` string
> in The name of the document to be searched for. Must be a key loaded in DocumentLibrary.
> `detectionZone` Rectangle
> in A delimited area in the image where to search for the document. Default is the full image. Output corners are in the full image referential.

Returns

> DetectedDocument
> Detected document in the image

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Java

    public DetectedDocument detectDocumentByName(DocumentImage image, String documentName, Rectangle detectionZone) throws DocumentException

Parameters

> `image` DocumentImage
> in The source image to process.
> `documentName` String
> in The name of the document to be searched for. Must be a key loaded in DocumentLibrary.
> `detectionZone` Rectangle
> in A delimited area in the image where to search for the document. Default is the full image. Output corners are in the full image referential.

Returns

> DetectedDocument
> Detected document in the image

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Swift

    public func detectDocumentByName(image: DocumentImage, documentName: String, detectionZone: Rectangle) throws -> DetectedDocument

Parameters

> `image` DocumentImage
> in The source image to process.
> `documentName` String
> in The name of the document to be searched for. Must be a key loaded in DocumentLibrary.
> `detectionZone` Rectangle
> in A delimited area in the image where to search for the document. Default is the full image. Output corners are in the full image referential.

Returns

> DetectedDocument
> Detected document in the image

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

C

    int id3DocumentDetector_DetectDocumentByName (
        ID3_DOCUMENT_DETECTOR hDocumentDetector,
        ID3_DOCUMENT_IMAGE hImage,
        const char * documentName,
        const id3DocumentRectangle * sDetectionZone,
        ID3_DETECTED_DOCUMENT hDetectedDocument)

Parameters

> `hDocumentDetector` ID3_DOCUMENT_DETECTOR
> in Handle to the DocumentDetector object.
> `hImage` ID3_DOCUMENT_IMAGE
> in The source image to process.
> `documentName` const char *
> in The name of the document to be searched for. Must be a key loaded in DocumentLibrary.
> `sDetectionZone` const id3DocumentRectangle *
> in A delimited area in the image where to search for the document. Default is the full image. Output corners are in the full image referential.
> `hDetectedDocument` ID3_DETECTED_DOCUMENT
> out Detected document in the image

Returns

> `int`
> An error code.
> See id3DocumentError file for the list of possible error codes.