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.

measureColor

Measure color reproduction using Imatest® eSFR chart

Syntax

colorTable = measureColor(chart)
[colorTable,colorCorrectionMatrix] = measureColor(chart)

Description

example

colorTable = measureColor(chart) measures the color values at all color regions of interest (ROIs) of an Imatest® eSFR chart.

[colorTable,colorCorrectionMatrix] = measureColor(chart) also returns a color correction matrix computed using a linear least squares fit.

Examples

collapse all

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

I = imread('eSFRTestImage.jpg');
I_lin = rgb2lin(I);

Create an esfrChart object, then display the chart with ROI annotations. The 16 color patch ROIs are labeled with white numbers.

chart = esfrChart(I_lin);
displayChart(chart,'displayEdgeROIs',false,...
    'displayGrayROIs',false,'displayRegistrationPoints',false)

Measure the color in all color patch ROIs.

colorTable = measureColor(chart)
colorTable=16x8 table
    ROI    Measured_R    Measured_G    Measured_B    Reference_L    Reference_a    Reference_b    Delta_E
    ___    __________    __________    __________    ___________    ___________    ___________    _______

     1      14            10            11           38.586            7.541         7.0812       36.788 
     2      85            54            49           62.182           13.225         13.826       36.391 
     3      17            29            80           49.369         -0.51463        -20.062       41.597 
     4      12            20            11           43.926          -6.8587         17.278       40.927 
     5      35            39           105           53.415            9.457        -22.822       39.596 
     6      46           110           127            69.95          -20.889       -0.21752       31.434 
     7     171           134            15           78.643           1.8052         67.091       22.042 
     8      82            17            65           46.853           41.998        -17.056       29.626 
     9      12            48           120            51.05          -15.166        -22.416       49.155 
    10      10            20           124           40.811           8.7346        -44.265       40.879 
    11      20            62            17           55.716          -23.419         28.839       33.885 
    12      80             9            19           42.759           44.167         7.9536       30.788 
    13     101            26             9           58.211            27.58         47.578       41.024 
    14      69            13            25           47.012            39.15         8.5453       35.667 
    15      27            15            34           40.591           17.951         -9.525       35.196 
    16      80           121            21           70.505          -16.318         49.811       28.129 

Display the color accuracy measurements. Each square color patch is the measured color, and the thick surrounding border is the reference color for that ROI. Each color accuracy measurement is displayed as Delta_E, the Euclidean distance between measured and reference colors in the CIE 1976 L*a*b* color space. More accurate colors have a smaller Delta_E.

displayColorPatch(colorTable)

For this image of the test chart, all measured colors have a large Delta_E and the colors are darker than the reference colors. This indicates a potential problem during image acquisition, such as underexposure or insufficient scene illumination.

For an alternative representation of the color accuracy measurements, plot the measured and reference colors in the CIE 1976 L*a*b* color space on a chromaticity diagram. Red circles indicate the reference color. Green circles indicate the measured color of each color patch. The chromaticity diagram does not portray the brightness of color.

plotChromaticity(colorTable)

ROIs with a shorter distance between the reference and measurement points have smaller differences in chromaticity, which can contribute to a smaller value of Delta_E. However, brightness also contributes to the value of Delta_E. Even though the reference and measurement points for ROI 7 are near each other on the chromaticity diagram, they have a large Delta_E because of their large difference in brightness.

Input Arguments

collapse all

eSFR chart, specified as an esfrChart object.

Output Arguments

collapse all

Color values in each color patch, returned as a 16-by-8 table. The 16 rows correspond to the 16 color patches on the eSFR chart.

The eight columns represent these variables:

VariableDescription
ROIIndex of the sampled ROI. The value of ROI is an integer in the range [1, 16]. The indices match the ROI numbers displayed by displayChart.
Measured_R

Mean value of red channel pixels in an ROI. Measured_R is a scalar of the same data type as chart.Image, which can be of type single, double, uint8, or uint16.

Measured_G

Mean value of green channel pixels in an ROI. Measured_G is a scalar of the same data type as chart.Image.

Measured_B

Mean value of blue channel pixels in an ROI. Measured_B is a scalar of the same data type as chart.Image.

Reference_L

Reference L* value corresponding to the ROI. Reference_L is a scalar of type double.

Reference_a

Reference a* value corresponding to the ROI. Reference_a is a scalar of type double.

Reference_b

Reference b* value corresponding to the ROI. Reference_b is a scalar of type double.

Delta_EEuclidean color distance between the measured and reference color values, as outlined in CIE 1976.

Color correction coefficients, returned as a 4-by-3 matrix. colorCorrectionMatrix represents an affine transformation, used to color-correct images that are captured under similar lighting conditions as the test chart image.

Data Types: double

Tips

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

Introduced in R2017b

Was this topic helpful?