Python API

Detailed Information

bob.ip.qualitymeasure.get_config()[source]

Returns a string containing the configuration information.

bob.ip.qualitymeasure.compute_msu_iqa_features(rgbImage)[source]

Computes image-quality features for the given input color (RGB) image. This is the main function to call.

Parameters:

rgbImage (numpy.ndarray): A uint8 array with 3 dimensions,
representing the RGB input image of shape [3,M,N] (M rows x N cols).

Returns:

featSet (numpy.ndarray): a 1D numpy array of 121 float32
scalars. This function returns the image-quality features (for face anti- spoofing) that have been described by Wen et al. in their paper: “Face spoof detection with image distortion analysis”, IEEE Trans. on Information Forensics and Security, vol. 10(4), pp. 746-761, April 2015.
bob.ip.qualitymeasure.compute_quality_features(image, smoothed=None)[source]

Extract a set of image quality-features computed for the input image.

Parameters:

image (numpy.ndarray): A uint8 array with 2 or 3
dimensions, representing the input image of shape [M,N] (M rows x N cols). If 2D, image should contain a gray-image of shape [M,N]. If 3D, image should have a shape [3,M,N], and should contain an RGB-image.
smoothed None or numpy.ndarray
A uint8 array with 2 or 3 dimensions, representing the smoothed version of the input image of shape [M,N] (M rows x N cols). If 2D, image should contain a gray-image of shape [M,N]. If 3D, image should have a shape [3,M,N], and should contain an RGB-image. Default: None

Returns:

featSet (numpy.ndarray): a 1D numpy array of 18 float32
scalars, each representing one image-quality measure. This function returns a subset of the image-quality features (for face anti-spoofing) that have been described by Galbally et al. in their paper: “Image Quality Assessment for Fake Biometric Detection: Application to Iris, Fingerprint, and Face Recognition”, IEEE Trans. on Image Processing Vol 23(2), 2014.
bob.ip.qualitymeasure.remove_highlights(image) → specular_free_image, diffuse_image, specular_residue, epsilon

This function implements a specular highlight removal algorithm.

This function implements a specular highlight removal algorithm which, by using an iterative process, separates the specular component from the diffuse component of the picture. It returns a color incorect specular free image, the diffuse component and the specular residue, respectively. It is based on the original code by Robby T. Tan reference: separating reflection components of textured surfaces using a single image by Robby T. Tan, Katsushi Ikeuchi, IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 27(2), pp.179-193, February, 2005

Parameters:

image : array_like (3D, float32)

The image to process

Returns:

specular_free_image : array_like (3D, float32)

Specular free image with altered colors.

diffuse_image : array_like (3D, float32)

Diffuse component image, free of specularity.

specular_residue : array_like (3D, float32)

Specular residue of the image.

epsilon : float32

Parameter that specifies the number of iterations.