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

# TrackedFace.getPortraitBounds Method

Module: TrackedFace

## Definition

Gets the bounding box of the detected face for ICAO portrait cropping.

This method shall be used to ensure compliance with the ICAO standard.

Python

    get_portrait_bounds(self, eye_image_width_ratio: float, eye_image_height_ratio: float, image_ratio: float) -> Rectangle

Parameters

> `eye_image_width_ratio` float
> in Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.
> `eye_image_height_ratio` float
> in Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.
> `image_ratio` float
> in Ratio between image height and image width. Default recommended value is 1.33 (4/3).

Returns

> Rectangle
> The portrait bounds of the detected face.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Dart

    Rectangle getPortraitBounds(double eyeImageWidthRatio, double eyeImageHeightRatio, double imageRatio)

Parameters

> `eyeImageWidthRatio` double
> in Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.
> `eyeImageHeightRatio` double
> in Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.
> `imageRatio` double
> in Ratio between image height and image width. Default recommended value is 1.33 (4/3).

Returns

> Rectangle
> The portrait bounds of the detected face.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C#

    public Rectangle GetPortraitBounds(float eyeImageWidthRatio, float eyeImageHeightRatio, float imageRatio)

Parameters

> `eyeImageWidthRatio` float
> in Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.
> `eyeImageHeightRatio` float
> in Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.
> `imageRatio` float
> in Ratio between image height and image width. Default recommended value is 1.33 (4/3).

Returns

> Rectangle
> The portrait bounds of the detected face.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Java

    public Rectangle getPortraitBounds(float eyeImageWidthRatio, float eyeImageHeightRatio, float imageRatio) throws FaceException

Parameters

> `eyeImageWidthRatio` float
> in Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.
> `eyeImageHeightRatio` float
> in Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.
> `imageRatio` float
> in Ratio between image height and image width. Default recommended value is 1.33 (4/3).

Returns

> Rectangle
> The portrait bounds of the detected face.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Swift

    public func getPortraitBounds(eyeImageWidthRatio: Float, eyeImageHeightRatio: Float, imageRatio: Float) throws -> Rectangle

Parameters

> `eyeImageWidthRatio` Float
> in Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.
> `eyeImageHeightRatio` Float
> in Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.
> `imageRatio` Float
> in Ratio between image height and image width. Default recommended value is 1.33 (4/3).

Returns

> Rectangle
> The portrait bounds of the detected face.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C

    int id3TrackedFace_GetPortraitBounds (
        ID3_TRACKED_FACE hTrackedFace,
        float eyeImageWidthRatio,
        float eyeImageHeightRatio,
        float imageRatio,
        id3FaceRectangle * sPortraitBounds)

Parameters

> `hTrackedFace` ID3_TRACKED_FACE
> in Handle to the TrackedFace object.
> `eyeImageWidthRatio` float
> in Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.
> `eyeImageHeightRatio` float
> in Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.
> `imageRatio` float
> in Ratio between image height and image width. Default recommended value is 1.33 (4/3).
> `sPortraitBounds` id3FaceRectangle *
> out The portrait bounds of the detected face.

Returns

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