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

# DocumentImage.extractRoiWithColor Method

Module: DocumentImage

## Definition

Extracts a region of interest in the image according to the given bounds.

Python

    extract_roi_with_color(self, bounds: Rectangle, color_red: int, color_green: int, color_blue: int) -> DocumentImage

Parameters

> `bounds` Rectangle
> in Bounds of the crop to extract.
> `color_red` int
> in Background color red (from 0 to 255)
> `color_green` int
> in Background color green (from 0 to 255)
> `color_blue` int
> in Background color blue (from 0 to 255)

Returns

> DocumentImage
> The extracted region of interest.

Exceptions

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

Dart

    DocumentImage extractRoiWithColor(Rectangle bounds, int colorRed, int colorGreen, int colorBlue)

Parameters

> `bounds` Rectangle
> in Bounds of the crop to extract.
> `colorRed` int
> in Background color red (from 0 to 255)
> `colorGreen` int
> in Background color green (from 0 to 255)
> `colorBlue` int
> in Background color blue (from 0 to 255)

Returns

> DocumentImage
> The extracted region of interest.

Exceptions

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

C#

    public DocumentImage ExtractRoiWithColor(Rectangle bounds, int colorRed, int colorGreen, int colorBlue)

Parameters

> `bounds` Rectangle
> in Bounds of the crop to extract.
> `colorRed` int
> in Background color red (from 0 to 255)
> `colorGreen` int
> in Background color green (from 0 to 255)
> `colorBlue` int
> in Background color blue (from 0 to 255)

Returns

> DocumentImage
> The extracted region of interest.

Exceptions

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

Java

    public DocumentImage extractRoiWithColor(Rectangle bounds, int colorRed, int colorGreen, int colorBlue) throws DocumentException

Parameters

> `bounds` Rectangle
> in Bounds of the crop to extract.
> `colorRed` int
> in Background color red (from 0 to 255)
> `colorGreen` int
> in Background color green (from 0 to 255)
> `colorBlue` int
> in Background color blue (from 0 to 255)

Returns

> DocumentImage
> The extracted region of interest.

Exceptions

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

Swift

    public func extractRoiWithColor(bounds: Rectangle, colorRed: Int32, colorGreen: Int32, colorBlue: Int32) throws -> DocumentImage

Parameters

> `bounds` Rectangle
> in Bounds of the crop to extract.
> `colorRed` Int32
> in Background color red (from 0 to 255)
> `colorGreen` Int32
> in Background color green (from 0 to 255)
> `colorBlue` Int32
> in Background color blue (from 0 to 255)

Returns

> DocumentImage
> The extracted region of interest.

Exceptions

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

C

    int id3DocumentImage_ExtractRoiWithColor (
        ID3_DOCUMENT_IMAGE hDocumentImage,
        const id3DocumentRectangle * sBounds,
        int colorRed,
        int colorGreen,
        int colorBlue,
        ID3_DOCUMENT_IMAGE hDocumentImageRoi)

Parameters

> `hDocumentImage` ID3_DOCUMENT_IMAGE
> in Handle to the DocumentImage object.
> `sBounds` const id3DocumentRectangle *
> in Bounds of the crop to extract.
> `colorRed` int
> in Background color red (from 0 to 255)
> `colorGreen` int
> in Background color green (from 0 to 255)
> `colorBlue` int
> in Background color blue (from 0 to 255)
> `hDocumentImageRoi` ID3_DOCUMENT_IMAGE
> out The extracted region of interest.

Returns

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