Main Content

measureChromaticAberration

Measure chromatic aberration at slanted edges usingImatesteSFR chart

Description

example

aberrationTable= measureChromaticAberration(chart)measures the chromatic aberration at all slanted edge regions of interest (ROIs) of an Imatest®eSFR chart[1].

aberrationTable= measureChromaticAberration(chart,Name,Value)measures the chromatic aberration with additional parameters to specify a subset of ROIs to measure.

Examples

collapse all

Read an image of an eSFR chart into the workspace.

I = imread('eSFRTestImage.jpg');

Create anesfrChartobject, then display the chart with ROI annotations. The 60 slanted edge ROIs are labeled with green numbers.

chart = esfrChart(I); displayChart(chart,'displayColorROIs',false,...'displayGrayROIs',false,'displayRegistrationPoints',false)

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

Measure the chromatic aberration in all slanted edge ROIs. Examine the contents of the returned table,chTable, for a single ROI.

chTable = measureChromaticAberration(chart); ROIIndex = 3; chTable(3,:)
ans=1×5 tableROI aberration percentAberration edgeProfile normalizedEdgeProfile ___ __________ _________________ _____________ _____________________ 3 1.5261 0.11843 {336x4 table} {336x4 table}

Store the normalized edge profile in a separate variable,edgeProfile, for clarity. Examine the normalized color intensity of the first and last pixel ofedgeProfile.

edgeProfile = chTable.normalizedEdgeProfile{ROIIndex}; edgeProfile([1 end],:)
ans=2×4 tablenormalizedEdgeProfile_R normalizedEdgeProfile_G normalizedEdgeProfile_B normalizedEdgeProfile_Y _______________________ _______________________ _______________________ _______________________ -0.0014365 0.0072757 0.0089823 0.0052007 0.98138 0.9884 0.98325 0.98792

Plot the normalized intensity for the ROI.

npix = length(edgeProfile.normalizedEdgeProfile_R); plot(1:npix,edgeProfile.normalizedEdgeProfile_R,'r',...1:npix,edgeProfile.normalizedEdgeProfile_G,'g',...1:npix,edgeProfile.normalizedEdgeProfile_B,'b') xlabel('Pixel') ylabel('Normalized Intensity') title(['ROI 'num2str(ROIIndex)' with Aberration 'num2str(chTable.aberration(ROIIndex))])

Figure eSFR test chart contains an axes object. The axes object with title ROI 3 with Aberration 1.5261 contains 3 objects of type line.

The blue channel has a higher intensity than the red and green channels immediately before the edge, and a lower intensity than the red and green channels immediately after the edge. This difference in intensity contributes to the measured value of chromatic aberration.

The measured values ofaberrationandpercentAberrationfor this edge are relatively small. Visual inspection of the image confirms that the sides of the edge do not have a strong color tint.

Input Arguments

collapse all

eSFR chart, specified as anesfrChartobject.

Name-Value Arguments

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, whereNameis the argument name andValueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

Example:'ROIIndex',2measures the chromatic aberration only of ROI 2.

ROI indices to include in measurements, specified as the comma-separated pair consisting of'ROIIndex'and a scalar or vector of integers in the range [1, 60]. The indices match the ROI numbers displayed bydisplayChart.

Note

measureChromaticAberrationuses the intersection of ROIs specified by'ROIIndex'and'ROIOrientation'.

Example:29:32

Data Types:single|double|int8|int16|int32|uint8|uint16|uint32

ROI orientation, specified as the comma-separated pair consisting of'ROIOrientation'and'both','vertical', or'horizontal'. ThemeasureChromaticAberrationfunction performs measurements only on ROIs with the specified orientation.

Note

measureChromaticAberrationuses the intersection of ROIs specified by'ROIIndex'and'ROIOrientation'.

Example:'vertical'

Data Types:char|string

Output Arguments

collapse all

Chromatic aberration measurements, returned as anm-by-5 table.mis the number of sampled ROIs.

The five columns represent these variables:

Variable Description
ROI Index of the sampled ROI. The value ofROIis an integer in the range [1, 60].
aberration

Chromatic aberration, measured as the area between the maximum and the minimum red, green, and blue edge intensity profiles. The measured chromatic aberration indicates perceptual chromatic aberration.aberrationis a scalar of typedouble.

percentAberration Aberration, expressed as a percentage of the distance in pixels between the center of the image and the center of the ROI.
edgeProfile

Intensity profile of each color channel across the edge in the ROI.edgeProfileis ans-by-4 table, wheresis the number of samples across the edge. The four columns represent the red, green, blue, and luminance values, averaged along the edge.

Luminance (Y) is a linear combination of the red (R), green (G), and blue (B) channels according to:

Y= 0.213R+ 0.715G+ 0.072B

Note

The sampling rate for the chromatic aberration measurement is about four times the sampling rate of the image.

normalizedEdgeProfile

Intensity profile, normalized between [0, 1] using 5% of the front end and tail end of data.normalizedEdgeProfileis ans-by-4 table with a similar structure toedgeProfile.

Tips

  • Chromatic aberration is best measured at slanted edges that are:

    • Roughly orthogonal to the line connecting the center of the image and the center of the ROI

    • Farthest from the center of the image

    Because chromatic aberration increases radially from the center of the image, measurements at slanted edges near the center of the image can be ignored.

  • The absolute chromatic aberration reported in theaberrationfield is measured in the horizontal or vertical direction. However, chromatic aberration is a radial phenomenon, and radial measurements are more accurate.

References

[1]实践上。“Esfr”。https://www.imatest.com/mathworks/esfr/.

Version History

Introduced in R2017b