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.
get_portrait_bounds(self, eye_image_width_ratio: float, eye_image_height_ratio: float, image_ratio: float) -> Rectangle
Parameters
eye_image_width_ratio
floatin Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.eye_image_height_ratio
floatin Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.image_ratio
floatin 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
eyeImageWidthRatio
doublein Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.eyeImageHeightRatio
doublein Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.imageRatio
doublein 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
eyeImageWidthRatio
floatin Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.eyeImageHeightRatio
floatin Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.imageRatio
floatin 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
eyeImageWidthRatio
floatin Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.eyeImageHeightRatio
floatin Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.imageRatio
floatin 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
eyeImageWidthRatio
Floatin Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.eyeImageHeightRatio
Floatin Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.imageRatio
Floatin 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 id3TrackedFace_GetPortraitBounds (
ID3_TRACKED_FACE hTrackedFace,
float eyeImageWidthRatio,
float eyeImageHeightRatio,
float imageRatio,
id3FaceRectangle * sPortraitBounds)
Parameters
hTrackedFace
ID3_TRACKED_FACEin Handle to the TrackedFace object.eyeImageWidthRatio
floatin Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.eyeImageHeightRatio
floatin Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.imageRatio
floatin 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