Documentation

This is machine translation

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

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

measureIlluminant

Measure scene illuminant using Imatest® eSFR chart

Syntax

illuminant = measureIlluminant(chart)

Description

example

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

Examples

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');
figure
imshow(I)

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);
figure;
imshow(J)

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

Tips

  • 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?