DetectedFace.getPortraitBounds Method¶
Module: DetectedFace
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.
get_portrait_bounds(self, eye_image_width_ratio: float, eye_image_height_ratio: float, image_ratio: float) -> Rectangle
Parameters
eye_image_width_ratiofloatin Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.eye_image_height_ratiofloatin Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.image_ratiofloatin Ratio between image height and image width. Default recommended value is 1.33 (4/3).
Returns
The portrait bounds of the detected face.
Exceptions
An error has occurred during Face Library execution.
Rectangle getPortraitBounds(double eyeImageWidthRatio, double eyeImageHeightRatio, double imageRatio)
Parameters
eyeImageWidthRatiodoublein Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.eyeImageHeightRatiodoublein Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.imageRatiodoublein Ratio between image height and image width. Default recommended value is 1.33 (4/3).
Returns
The portrait bounds of the detected face.
Exceptions
An error has occurred during Face Library execution.
public Rectangle GetPortraitBounds(float eyeImageWidthRatio, float eyeImageHeightRatio, float imageRatio)
Parameters
eyeImageWidthRatiofloatin Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.eyeImageHeightRatiofloatin Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.imageRatiofloatin Ratio between image height and image width. Default recommended value is 1.33 (4/3).
Returns
The portrait bounds of the detected face.
Exceptions
An error has occurred during Face Library execution.
public Rectangle getPortraitBounds(float eyeImageWidthRatio, float eyeImageHeightRatio, float imageRatio) throws FaceException
Parameters
eyeImageWidthRatiofloatin Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.eyeImageHeightRatiofloatin Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.imageRatiofloatin Ratio between image height and image width. Default recommended value is 1.33 (4/3).
Returns
The portrait bounds of the detected face.
Exceptions
An error has occurred during Face Library execution.
public func getPortraitBounds(eyeImageWidthRatio: Float, eyeImageHeightRatio: Float, imageRatio: Float) throws -> Rectangle
Parameters
eyeImageWidthRatioFloatin Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.eyeImageHeightRatioFloatin Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.imageRatioFloatin Ratio between image height and image width. Default recommended value is 1.33 (4/3).
Returns
The portrait bounds of the detected face.
Exceptions
An error has occurred during Face Library execution.
int id3DetectedFace_GetPortraitBounds (
ID3_DETECTED_FACE hDetectedFace,
float eyeImageWidthRatio,
float eyeImageHeightRatio,
float imageRatio,
id3FaceRectangle * sPortraitBounds)
Parameters
hDetectedFaceID3_DETECTED_FACEin Handle to the DetectedFace object.eyeImageWidthRatiofloatin Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.eyeImageHeightRatiofloatin Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.imageRatiofloatin Ratio between image height and image width. Default recommended value is 1.33 (4/3).sPortraitBoundsid3FaceRectangle *out The portrait bounds of the detected face.
Returns