.. index:: 
  !Image.extractRoiWithColor Method
  
.. _id3_face_image_extract_roi_with_color_class_method:

===============================================================================
Image.extractRoiWithColor Method
===============================================================================

Module: :ref:`Image<id3_face_image_class>`

Definition
----------

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


.. tab-set::

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

      .. code:: Python

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

      **Parameters**

        .. line-block::

          ``bounds`` :ref:`Rectangle<id3_face_rectangle_struct>`
          :guilabel:`in` Bounds of the crop to extract.

          ``color_red`` int
          :guilabel:`in` Background color red (from 0 to 255)

          ``color_green`` int
          :guilabel:`in` Background color green (from 0 to 255)

          ``color_blue`` int
          :guilabel:`in` Background color blue (from 0 to 255)


      **Returns**

        .. line-block::

          :ref:`Image<id3_face_image_class>`
          The extracted region of interest.

      **Exceptions**

        .. line-block::

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


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

      .. code:: Dart

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

      **Parameters**

        .. line-block::

          ``bounds`` :ref:`Rectangle<id3_face_rectangle_struct>`
          :guilabel:`in` Bounds of the crop to extract.

          ``colorRed`` int
          :guilabel:`in` Background color red (from 0 to 255)

          ``colorGreen`` int
          :guilabel:`in` Background color green (from 0 to 255)

          ``colorBlue`` int
          :guilabel:`in` Background color blue (from 0 to 255)


      **Returns**

        .. line-block::

          :ref:`Image<id3_face_image_class>`
          The extracted region of interest.

      **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 Image ExtractRoiWithColor(Rectangle bounds, int colorRed, int colorGreen, int colorBlue)

      **Parameters**

        .. line-block::

          ``bounds`` :ref:`Rectangle<id3_face_rectangle_struct>`
          :guilabel:`in` Bounds of the crop to extract.

          ``colorRed`` int
          :guilabel:`in` Background color red (from 0 to 255)

          ``colorGreen`` int
          :guilabel:`in` Background color green (from 0 to 255)

          ``colorBlue`` int
          :guilabel:`in` Background color blue (from 0 to 255)


      **Returns**

        .. line-block::

          :ref:`Image<id3_face_image_class>`
          The extracted region of interest.

      **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 Image extractRoiWithColor(Rectangle bounds, int colorRed, int colorGreen, int colorBlue) throws FaceException

      **Parameters**

        .. line-block::

          ``bounds`` :ref:`Rectangle<id3_face_rectangle_struct>`
          :guilabel:`in` Bounds of the crop to extract.

          ``colorRed`` int
          :guilabel:`in` Background color red (from 0 to 255)

          ``colorGreen`` int
          :guilabel:`in` Background color green (from 0 to 255)

          ``colorBlue`` int
          :guilabel:`in` Background color blue (from 0 to 255)


      **Returns**

        .. line-block::

          :ref:`Image<id3_face_image_class>`
          The extracted region of interest.

      **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 extractRoiWithColor(bounds: Rectangle, colorRed: Int32, colorGreen: Int32, colorBlue: Int32) throws -> Image

      **Parameters**

        .. line-block::

          ``bounds`` :ref:`Rectangle<id3_face_rectangle_struct>`
          :guilabel:`in` Bounds of the crop to extract.

          ``colorRed`` Int32
          :guilabel:`in` Background color red (from 0 to 255)

          ``colorGreen`` Int32
          :guilabel:`in` Background color green (from 0 to 255)

          ``colorBlue`` Int32
          :guilabel:`in` Background color blue (from 0 to 255)


      **Returns**

        .. line-block::

          :ref:`Image<id3_face_image_class>`
          The extracted region of interest.

      **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 id3FaceImage_ExtractRoiWithColor (
            ID3_FACE_IMAGE hImage, 
            const id3FaceRectangle * sBounds, 
            int colorRed, 
            int colorGreen, 
            int colorBlue, 
            ID3_FACE_IMAGE hImageRoi)

      **Parameters**

        .. line-block::

          ``hImage`` :ref:`ID3_FACE_IMAGE<id3_face_image_class>`
          :guilabel:`in` Handle to the Image object.

          ``sBounds`` :ref:`const id3FaceRectangle *<id3_face_rectangle_struct>`
          :guilabel:`in` Bounds of the crop to extract.

          ``colorRed`` int
          :guilabel:`in` Background color red (from 0 to 255)

          ``colorGreen`` int
          :guilabel:`in` Background color green (from 0 to 255)

          ``colorBlue`` int
          :guilabel:`in` Background color blue (from 0 to 255)

          ``hImageRoi`` :ref:`ID3_FACE_IMAGE<id3_face_image_class>`
          :guilabel:`out` The extracted region of interest.


      **Returns**

        .. line-block::

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


