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. Click here to see
To view all translated materials including this page, select Country 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 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, ...
    'displayColorROIs',false,'displayRegistrationPoints',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);
imshow(J)
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

Tips

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

Introduced in R2017b