illumgray
Estimate illuminant using gray world algorithm
Syntax
Description
estimates the illumination of the scene in RGB image illuminant
= illumgray(A
)A
by
assuming that the average color of the scene is gray.
estimates the illumination, excluding the specified bottom and top percentiles of
pixel values.illuminant
= illumgray(A
,percentile
)
estimates the illumination using name-value arguments to control additional
options.illuminant
= illumgray(___,Name=Value
)
Examples
Input Arguments
Output Arguments
Tips
The gray world algorithm assumes uniform illumination and linear RGB values. If you are working with nonlinear sRGB or Adobe RGB images, use the
rgb2lin
function to undo the gamma correction before usingillumgray
. Also, make sure to convert the chromatically adapted image back to sRGB by using thelin2rgb
function.When you specify
Mask
, the bottom percentile and top percentile apply to the masked image.You can adjust the color balance of the image to remove the scene illumination by using the
chromadapt
function.
References
[1] Ebner, Marc. "The Gray World Assumption." Color Constancy. Chichester, West Sussex: John Wiley & Sons, 2007.
Version History
Introduced in R2017b
See Also
chromadapt
| illumpca
| illumwhite
| lin2rgb
| rgb2lin