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

# DocumentDetector Class

Namespace: id3.Document

## Definition

Detects documents in images.
Python

    class DocumentDetector

Dart

    class DocumentDetector implements Finalizable

C#

    public partial class DocumentDetector

Java

    public class DocumentDetector implements AutoCloseable, Serializable

Swift

    public class DocumentDetector

C

    typedef struct id3DocumentDetector *ID3_DOCUMENT_DETECTOR;

## Usage

Python

    documentDetectorInstance = DocumentDetector()
    # ...

Explicit destruction

    # ...
    del documentDetectorInstance

Dart

    final documentDetectorInstance = sdk.DocumentDetector();
    // ...

Explicit destruction

    // ...
    documentDetectorInstance.dispose()

C#

    using (var documentDetectorInstance = new DocumentDetector())
    {
       // ...
    }

Explicit destruction

    var documentDetectorInstance = new DocumentDetector()
    // ...
    documentDetectorInstance.Dispose()

Java

    try (DocumentDetector documentDetectorInstance = new DocumentDetector()) {
    // ...
    }

Explicit destruction

    DocumentDetector documentDetectorInstance = new DocumentDetector();
    // ...
    documentDetectorInstance.close();

Swift

    private var documentDetectorInstance: DocumentDetector? = nil
    documentDetectorInstance = try DocumentDetector()

C

    ID3_DOCUMENT_DETECTOR hDocumentDetector{};
    int err = id3DocumentDetector_Initialize(&hDocumentDetector);
    if (err == ID3_SUCCESS) {
        // ...
        id3DocumentDetector_Dispose(&hDocumentDetector);
    }

## Properties

Name | Type | Description
--- | --- | ---
confidenceThreshold | int | Confidence threshold, from 0 to 100+.
documentWidthRatio | float | Ratio of the estimated width of the searched document in the image.
model | DocumentModel | Model to be used for document detection.
processingUnit | ProcessingUnit | Processing unit where to run the detection process.
threadCount | int | Number of threads to use for detection.

## Methods

Name | Description
--- | ---
alignDocument | Aligns and crops the specified document on the specified image and returns a new DocumentImage.
detectDocument | Detects a document on a delimited area of the specified DocumentImage and returns a DetectedDocument.
detectDocumentByName | Detects a document with specified name on a delimited area of the specified DocumentImage and returns a DetectedDocument.