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

# DetectedFace.getExpandedBounds Method

Module: DetectedFace

## Definition

Gets the bounding box around the detected face with specified aspect ratio and specified margin.

Python

    get_expanded_bounds(self, aspect_ratio: float, margin: float) -> Rectangle

Parameters

> `aspect_ratio` float
> in Aspect ratio of the bounding box. Default recommended value is 1.33 (4/3).
> `margin` float
> in Relative margin around the detected face. Recommended value is 0.5.

Returns

> Rectangle
> The portrait bounds.

Exceptions

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

Dart

    Rectangle getExpandedBounds(double aspectRatio, double margin)

Parameters

> `aspectRatio` double
> in Aspect ratio of the bounding box. Default recommended value is 1.33 (4/3).
> `margin` double
> in Relative margin around the detected face. Recommended value is 0.5.

Returns

> Rectangle
> The portrait bounds.

Exceptions

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

C#

    public Rectangle GetExpandedBounds(float aspectRatio, float margin)

Parameters

> `aspectRatio` float
> in Aspect ratio of the bounding box. Default recommended value is 1.33 (4/3).
> `margin` float
> in Relative margin around the detected face. Recommended value is 0.5.

Returns

> Rectangle
> The portrait bounds.

Exceptions

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

Java

    public Rectangle getExpandedBounds(float aspectRatio, float margin) throws FaceException

Parameters

> `aspectRatio` float
> in Aspect ratio of the bounding box. Default recommended value is 1.33 (4/3).
> `margin` float
> in Relative margin around the detected face. Recommended value is 0.5.

Returns

> Rectangle
> The portrait bounds.

Exceptions

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

Swift

    public func getExpandedBounds(aspectRatio: Float, margin: Float) throws -> Rectangle

Parameters

> `aspectRatio` Float
> in Aspect ratio of the bounding box. Default recommended value is 1.33 (4/3).
> `margin` Float
> in Relative margin around the detected face. Recommended value is 0.5.

Returns

> Rectangle
> The portrait bounds.

Exceptions

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

C

    int id3DetectedFace_GetExpandedBounds (
        ID3_DETECTED_FACE hDetectedFace,
        float aspectRatio,
        float margin,
        id3FaceRectangle * sPortraitBounds)

Parameters

> `hDetectedFace` ID3_DETECTED_FACE
> in Handle to the DetectedFace object.
> `aspectRatio` float
> in Aspect ratio of the bounding box. Default recommended value is 1.33 (4/3).
> `margin` float
> in Relative margin around the detected face. Recommended value is 0.5.
> `sPortraitBounds` id3FaceRectangle *
> out The portrait bounds.

Returns

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