Python API

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

Returns a string containing the configuration information.

class bob.ip.skincolorfilter.SkinColorFilter[source]

This class implements a number of functions to perform skin color filtering.

It is based on the work published in “Adaptive skin segmentation via feature-based face detection”, M.J. Taylor and T. Morris, Proc SPIE Photonics Europe, 2014 [taylor-spie-2014]

Attributes:
mean
: (numpy array 2x1)
the mean skin color
covariance
: (numpy array 2x2)
the covariance matrix of the skin color
covariance_inverse
: (numpy array 2x2)
the inverse covariance matrix of the skin color
circular_mask
: (numpy logical array)
mask of the size of the image, defining a circular region in the center
luma_mask
: (numpy logical array)
mask of the size of the image, defining valid luma values
estimate_gaussian_parameters(image)[source]

This function estimates the parameter of the skin color distribution.

The mean and covariance matrix of the skin pixels in the normalised rg colorspace are computed. Note that only the pixels for which both the circular and the luma mask is ‘True’ are considered.

Parameters:

image
: (numpy array)
The face image.
get_skin_mask(image[, threshold]) → skin_mask[source]

This function computes the probability of skin-color for each pixel in the image.

Parameters:

image
: (numpy array)
The face image.
threshold
: (Optional, float between 0 and 1)
the threshold on the skin color probability. Defaults to 0.5

Returns:

skin_mask : (numpy logical array) The mask where skin color pixels are labeled as True.