This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.


Measure scene illuminant using Imatest® eSFR chart


illuminant = measureIlluminant(chart)



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


collapse all

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

Read an image of an eSFR chart into the workspace. Display the image.

I = imread('eSFRTestImage.jpg');

Linearize the image.

I_lin = rgb2lin(I);

Create an esfrChart object based on the linearized image, then display the chart with ROI annotations. The 20 gray patch ROIs are labeled with red numbers.

chart = esfrChart(I_lin);

Estimate the illuminant using the gray patch ROIs.

illum = measureIlluminant(chart)
illum = 

   69.2527   73.5922   80.5141

White balance the linearized chart image. Ideally the illuminant can be used to color balance images acquired under similar lighting conditions as the test chart.

J_lin = chromadapt(I_lin,illum,'ColorSpace','linear-rgb');

Gamma correct the white balanced image, and display the result.

J = lin2rgb(J_lin);

The white balanced image has less of a blue tint to it, especially in the middle gray patches and over the background of the image.

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


  • You can use illuminant to white-balance images acquired under similar lighting conditions as the test chart.

  • Perform illuminant measurements only on linearized data. Use rgb2lin to linearize sRGB images.

Introduced in R2017b

Was this topic helpful?