Measure scene illuminant using Imatest eSFR chart



illuminant = measureIlluminant(chart) measures the scene illuminant using the gray regions of interest (ROIs) of an Imatest® Extended eSFR chart [1].


collapse all

This example shows how to measure the illuminant of an eSFR chart using the gray patch ROIs. The example then white balances the image of the eSFR chart.

Read an image of an eSFR chart into the workspace.

I = imread('eSFRTestImage.jpg');

Create an esfrChart object. Display the chart, highlighting the 20 gray patches.

chart = esfrChart(I);
displayChart(chart,'displayEdgeROIs',false, ...

Estimate the illuminant using the gray patch ROIs. The illuminant has a stronger blue component than the red and green. This result is consistent with the image of the test chart, which has a blue tint.

illum = measureIlluminant(chart)
illum = 1×3

  110.9147  116.0008  123.2339

White balance the chart image and display the result. The white balanced image has less of a blue tint, especially in the middle gray patches and over the background of the image.

J = chromadapt(I,illum);
title('White Balanced Test Chart Image')

You can use the estimated illuminant to white balance other images acquired under similar lighting conditions.

Input Arguments

collapse all

eSFR chart, specified as an esfrChart object.

Output Arguments

collapse all

Scene illuminant, returned as a 3-element row vector.

Data Types: double


  • To white-balance an image, use the chromadapt function.


Introduced in R2017b