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

# DocumentImage.compare Method

Module: DocumentImage

## Definition

Computes the difference with another image.

Python

    compare(self, cmp_document_image: DocumentImage) -> float

Parameters

> `cmp_document_image` DocumentImage
> in The image to compare.

Returns

> `float`
> Comparison result in percent (0% is same, 100% is full different).

Exceptions

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

Dart

    double compare(DocumentImage cmpDocumentImage)

Parameters

> `cmpDocumentImage` DocumentImage
> in The image to compare.

Returns

> `double`
> Comparison result in percent (0% is same, 100% is full different).

Exceptions

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

C#

    public float Compare(DocumentImage cmpDocumentImage)

Parameters

> `cmpDocumentImage` DocumentImage
> in The image to compare.

Returns

> `float`
> Comparison result in percent (0% is same, 100% is full different).

Exceptions

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

Java

    public float compare(DocumentImage cmpDocumentImage) throws DocumentException

Parameters

> `cmpDocumentImage` DocumentImage
> in The image to compare.

Returns

> `float`
> Comparison result in percent (0% is same, 100% is full different).

Exceptions

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

Swift

    public func compare(cmpDocumentImage: DocumentImage) throws -> Float

Parameters

> `cmpDocumentImage` DocumentImage
> in The image to compare.

Returns

> `Float`
> Comparison result in percent (0% is same, 100% is full different).

Exceptions

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

C

    int id3DocumentImage_Compare (
        ID3_DOCUMENT_IMAGE hDocumentImage,
        ID3_DOCUMENT_IMAGE hCmpDocumentImage,
        float * result)

Parameters

> `hDocumentImage` ID3_DOCUMENT_IMAGE
> in Handle to the DocumentImage object.
> `hCmpDocumentImage` ID3_DOCUMENT_IMAGE
> in The image to compare.
> `result` float *
> out Comparison result in percent (0% is same, 100% is full different).

Returns

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