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

# DocumentDetector.detectDocument Method

Module: DocumentDetector

## Definition

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

Important

Document templates must be loaded before calling this method.

Python

    detect_document(self, image: DocumentImage, detection_zone: Rectangle) -> DetectedDocument

Parameters

> `image` DocumentImage
> in Source image to process
> `detection_zone` Rectangle
> in Crop in the image where to look for 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 detectDocument(DocumentImage image, Rectangle detectionZone)

Parameters

> `image` DocumentImage
> in Source image to process
> `detectionZone` Rectangle
> in Crop in the image where to look for 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 DetectDocument(DocumentImage image, Rectangle detectionZone)

Parameters

> `image` DocumentImage
> in Source image to process
> `detectionZone` Rectangle
> in Crop in the image where to look for 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 detectDocument(DocumentImage image, Rectangle detectionZone) throws DocumentException

Parameters

> `image` DocumentImage
> in Source image to process
> `detectionZone` Rectangle
> in Crop in the image where to look for 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 detectDocument(image: DocumentImage, detectionZone: Rectangle) throws -> DetectedDocument

Parameters

> `image` DocumentImage
> in Source image to process
> `detectionZone` Rectangle
> in Crop in the image where to look for 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_DetectDocument (
        ID3_DOCUMENT_DETECTOR hDocumentDetector,
        ID3_DOCUMENT_IMAGE hImage,
        const id3DocumentRectangle * sDetectionZone,
        ID3_DETECTED_DOCUMENT hDetectedDocument)

Parameters

> `hDocumentDetector` ID3_DOCUMENT_DETECTOR
> in Handle to the DocumentDetector object.
> `hImage` ID3_DOCUMENT_IMAGE
> in Source image to process
> `sDetectionZone` const id3DocumentRectangle *
> in Crop in the image where to look for 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.