DocumentDetector.alignDocument Method

Module: DocumentDetector

Definition

Aligns and crops the specified document on the specified image and returns a new DocumentImage.

align_document(self, source_image: DocumentImage, detected_document: DetectedDocument) -> DocumentImage

Parameters

source_image DocumentImage
in The source image containing the document.

detected_document DetectedDocument
in The detected document in the image.

Returns

Realigned and cropped image of the document.

Exceptions

An error has occurred during Document Library execution.
DocumentImage alignDocument(DocumentImage sourceImage, DetectedDocument detectedDocument)

Parameters

sourceImage DocumentImage
in The source image containing the document.

detectedDocument DetectedDocument
in The detected document in the image.

Returns

Realigned and cropped image of the document.

Exceptions

An error has occurred during Document Library execution.
public DocumentImage AlignDocument(DocumentImage sourceImage, DetectedDocument detectedDocument)

Parameters

sourceImage DocumentImage
in The source image containing the document.

detectedDocument DetectedDocument
in The detected document in the image.

Returns

Realigned and cropped image of the document.

Exceptions

An error has occurred during Document Library execution.
public DocumentImage alignDocument(DocumentImage sourceImage, DetectedDocument detectedDocument) throws DocumentException

Parameters

sourceImage DocumentImage
in The source image containing the document.

detectedDocument DetectedDocument
in The detected document in the image.

Returns

Realigned and cropped image of the document.

Exceptions

An error has occurred during Document Library execution.
public func alignDocument(sourceImage: DocumentImage, detectedDocument: DetectedDocument) throws -> DocumentImage

Parameters

sourceImage DocumentImage
in The source image containing the document.

detectedDocument DetectedDocument
in The detected document in the image.

Returns

Realigned and cropped image of the document.

Exceptions

An error has occurred during Document Library execution.
int id3DocumentDetector_AlignDocument (
    ID3_DOCUMENT_DETECTOR hDocumentDetector,
    ID3_DOCUMENT_IMAGE hSourceImage,
    ID3_DETECTED_DOCUMENT hDetectedDocument,
    ID3_DOCUMENT_IMAGE hAlignedImage)

Parameters

hDocumentDetector ID3_DOCUMENT_DETECTOR
in Handle to the DocumentDetector object.

hSourceImage ID3_DOCUMENT_IMAGE
in The source image containing the document.

hDetectedDocument ID3_DETECTED_DOCUMENT
in The detected document in the image.

hAlignedImage ID3_DOCUMENT_IMAGE
out Realigned and cropped image of the document.

Returns

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