Automatic thresholding based on skin luminance