.. index:: 
  !DetectedFace.getExpandedBounds Method
  
.. _id3_face_detected_face_get_expanded_bounds_class_method:

===============================================================================
DetectedFace.getExpandedBounds Method
===============================================================================

Module: :ref:`DetectedFace<id3_face_detected_face_class>`

Definition
----------

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


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

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

      **Parameters**

        .. line-block::

          ``aspect_ratio`` float
          :guilabel:`in` Aspect ratio of the bounding box. Default recommended value is 1.33 (4/3).

          ``margin`` float
          :guilabel:`in` Relative margin around the detected face. Recommended value is 0.5.


      **Returns**

        .. line-block::

          :ref:`Rectangle<id3_face_rectangle_struct>`
          The portrait bounds.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        Rectangle getExpandedBounds(double aspectRatio, double margin)

      **Parameters**

        .. line-block::

          ``aspectRatio`` double
          :guilabel:`in` Aspect ratio of the bounding box. Default recommended value is 1.33 (4/3).

          ``margin`` double
          :guilabel:`in` Relative margin around the detected face. Recommended value is 0.5.


      **Returns**

        .. line-block::

          :ref:`Rectangle<id3_face_rectangle_struct>`
          The portrait bounds.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public Rectangle GetExpandedBounds(float aspectRatio, float margin)

      **Parameters**

        .. line-block::

          ``aspectRatio`` float
          :guilabel:`in` Aspect ratio of the bounding box. Default recommended value is 1.33 (4/3).

          ``margin`` float
          :guilabel:`in` Relative margin around the detected face. Recommended value is 0.5.


      **Returns**

        .. line-block::

          :ref:`Rectangle<id3_face_rectangle_struct>`
          The portrait bounds.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

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

      **Parameters**

        .. line-block::

          ``aspectRatio`` float
          :guilabel:`in` Aspect ratio of the bounding box. Default recommended value is 1.33 (4/3).

          ``margin`` float
          :guilabel:`in` Relative margin around the detected face. Recommended value is 0.5.


      **Returns**

        .. line-block::

          :ref:`Rectangle<id3_face_rectangle_struct>`
          The portrait bounds.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

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

      **Parameters**

        .. line-block::

          ``aspectRatio`` Float
          :guilabel:`in` Aspect ratio of the bounding box. Default recommended value is 1.33 (4/3).

          ``margin`` Float
          :guilabel:`in` Relative margin around the detected face. Recommended value is 0.5.


      **Returns**

        .. line-block::

          :ref:`Rectangle<id3_face_rectangle_struct>`
          The portrait bounds.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

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

      **Parameters**

        .. line-block::

          ``hDetectedFace`` :ref:`ID3_DETECTED_FACE<id3_face_detected_face_class>`
          :guilabel:`in` Handle to the DetectedFace object.

          ``aspectRatio`` float
          :guilabel:`in` Aspect ratio of the bounding box. Default recommended value is 1.33 (4/3).

          ``margin`` float
          :guilabel:`in` Relative margin around the detected face. Recommended value is 0.5.

          ``sPortraitBounds`` :ref:`id3FaceRectangle *<id3_face_rectangle_struct>`
          :guilabel:`out` The portrait bounds.


      **Returns**

        .. line-block::

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


