Main Content

Evaluate Quality Metrics on eSFR Test Chart

This example shows how to perform standard quality measurements on an Imatest® edge spatial frequency response (eSFR) test chart. Measured properties include sharpness, chromatic aberration, noise, illumination, and color accuracy.

Create a Test Chart Object

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

I = imread("eSFRTestImage.jpg");
imshow(I)
title("Captured Image of eSFR Chart")
text(size(I,2),size(I,1)+15,["Chart courtesy of Imatest",char(174)], ...
    FontSize=10,HorizontalAlignment="right");

Figure contains an axes object. The hidden axes object with title Captured Image of eSFR Chart contains 2 objects of type image, text.

Create an eSFR test chart object that automatically defines regions of interest (ROIs) based on detected registration markers.

chart = esfrChart(I);

Highlight and label the detected ROIs to visually confirm that the ROIs are suitable for measurements.

displayChart(chart)

Figure eSFR test chart contains an axes object. The hidden axes object contains 97 objects of type image, text.

All 60 slanted edge ROIs (labeled in green) are visible and centered on appropriate edges. In addition, 20 gray patch ROIs (labeled in red) and 16 color patch ROIs (labeled in white) are visible and are contained within the boundary of each patch. The chart is correctly imported.

Measure Edge Sharpness

Measure the sharpness of all 60 slanted edge ROIs. Also measure the averaged horizontal and vertical sharpness of these ROIs.

[sharpnessTable,aggregateSharpnessTable] = measureSharpness(chart);

Display the SFR plot for the first four ROIs.

plotSFR(sharpnessTable,ROIIndex=1:4,displayLegend=false,displayTitle=true)

Figure SFR Plots for ROI 1 contains an axes object. The axes object with title ROI 1, xlabel Spatial Frequency (Line pairs per pixel), ylabel SFR (Spatial Frequency Response) contains 8 objects of type line.

Figure SFR Plots for ROI 2 contains an axes object. The axes object with title ROI 2, xlabel Spatial Frequency (Line pairs per pixel), ylabel SFR (Spatial Frequency Response) contains 8 objects of type line.

Figure SFR Plots for ROI 3 contains an axes object. The axes object with title ROI 3, xlabel Spatial Frequency (Line pairs per pixel), ylabel SFR (Spatial Frequency Response) contains 8 objects of type line.

Figure SFR Plots for ROI 4 contains an axes object. The axes object with title ROI 4, xlabel Spatial Frequency (Line pairs per pixel), ylabel SFR (Spatial Frequency Response) contains 8 objects of type line.

Display the average SFR of the averaged vertical and horizontal edges. The average vertical SFR drops off more rapidly than the average horizontal SFR. Therefore, the average vertical edge is less sharp than the average horizontal edge.

plotSFR(aggregateSharpnessTable)

Figure Average SFR Plots for Vertical ROIs contains an axes object. The axes object with title Average Vertical SFR, xlabel Spatial Frequency (Line pairs per pixel), ylabel SFR (Spatial Frequency Response) contains 8 objects of type line. These objects represent Red Channel, Green Channel, Blue Channel, Luminance Channel, Red Channel Beyond Nyquist, Green Channel Beyond Nyquist, Blue Channel Beyond Nyquist, Luminance Channel Beyond Nyquist.

Figure Average SFR Plots for Horizontal ROIs contains an axes object. The axes object with title Average Horizontal SFR, xlabel Spatial Frequency (Line pairs per pixel), ylabel SFR (Spatial Frequency Response) contains 8 objects of type line. These objects represent Red Channel, Green Channel, Blue Channel, Luminance Channel, Red Channel Beyond Nyquist, Green Channel Beyond Nyquist, Blue Channel Beyond Nyquist, Luminance Channel Beyond Nyquist.

Measure Chromatic Aberration

Measure chromatic aberration at all slanted edge ROIs.

chTable = measureChromaticAberration(chart);

Plot the normalized intensity profile of the three color channels in the first ROI. Store the normalized edge profile in a separate variable, edgeProfile, for clarity.

roi_index = 1;
edgeProfile = chTable.normalizedEdgeProfile{roi_index};

figure
p = length(edgeProfile.normalizedEdgeProfile_R);
plot(1:p,edgeProfile.normalizedEdgeProfile_R,"r", ...
     1:p,edgeProfile.normalizedEdgeProfile_G,"g", ...
     1:p,edgeProfile.normalizedEdgeProfile_B,"b")
xlabel("Pixel")
ylabel("Normalized Intensity")
title("ROI "+roi_index+" with Aberration "+chTable.aberration(1))

Figure contains an axes object. The axes object with title ROI 1 with Aberration 1.2617, xlabel Pixel, ylabel Normalized Intensity contains 3 objects of type line.

The color channels have similar normalized intensity profiles, and not much color fringing is visible along the edge.

Measure Noise

Measure noise using the 20 gray patch ROIs.

noiseTable = measureNoise(chart);

Plot the average raw signal and the signal-to-noise ratio (SNR) in each grayscale ROI.

figure
subplot(1,2,1)
plot(noiseTable.ROI,noiseTable.MeanIntensity_R,"r", ...
    noiseTable.ROI,noiseTable.MeanIntensity_G,"g", ...
    noiseTable.ROI,noiseTable.MeanIntensity_B,"b")
title("Signal")
ylabel("Intensity")
xlabel("Gray ROI Number")
grid on

subplot(1,2,2)
plot(noiseTable.ROI,noiseTable.SNR_R,"r", ...
    noiseTable.ROI,noiseTable.SNR_G,"g", ...
    noiseTable.ROI,noiseTable.SNR_B,"b")
title("SNR")
ylabel("dB")
xlabel("Gray ROI Number")
grid on

Figure contains 2 axes objects. Axes object 1 with title Signal, xlabel Gray ROI Number, ylabel Intensity contains 3 objects of type line. Axes object 2 with title SNR, xlabel Gray ROI Number, ylabel dB contains 3 objects of type line.

Estimate Illuminant

Estimate the scene illumination using the 20 gray patch ROIs. The illuminant has a stronger blue component a weaker red component, which is consistent with the blue tint of the test chart image.

illum = measureIlluminant(chart)
illum = 1×3

  110.9147  116.0008  123.2339

Measure Color Accuracy

Measure color accuracy using the 16 color patch ROIs.

[colorTable,ccm] = measureColor(chart);

Display the average measured color and the expected color of the ROIs. Display the color accuracy measurement, Delta_E. The closer the Delta_E value is to 1, the less perceptible the color difference is. Typical values of Delta_E range from 3 to 6 for printing, and up to 20 in other commercial applications.

figure
displayColorPatch(colorTable)

Figure Visual Color Comparison contains an axes object. The hidden axes object contains 17 objects of type image, text.

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.

figure
plotChromaticity(colorTable)

Figure contains an axes object. The axes object with xlabel x, ylabel y contains 34 objects of type surface, scatter, quiver, text.

You can use the color correction matrix, ccm, to color-correct the test chart images. For an example, see Correct Colors Using Color Correction Matrix.

References

See Also

| | | | | |

Related Topics