(Note: this page is not yet complete.)

Introduction

Wedge, which is opened from the Rescharts interface (Imatest Master-only), measures the MTF (Modulation Transfer Function) and the onset aliasing (related to the vanishing resoultion) from converging bar patterns, called "wedges", which are a part of many popular resolution test charts. "Hyerbolic" (linear in frequency) wedge patterns are central to the CIPA DC-003 standard for digital camera resolution measurement, which will be incorporated in a revision of the ISO 12233 resolution measurement standard.

Wedge can analyze vertical and horizontal (but not diagonal) wedges. To the best of our knowledge, Imatest Wedge is the only software that can calculate MTF from wedge patterns, but there is a significant limitation with the calculation: the results at the Nyquist frequency (and also 2/3 Nyquist) are highly sensitive tothe phase of the bars relative to the pixels, i.e., the sub-pixel positioning, which is difficult to control in practice.

The best-known chart that contains wedge patterns is the ISO 12233 resolution test chart. It contains 22 hyperbolic wedges: 10 vertical, 10 horizontal, and 2 diagonal.

ISO 12233 chart
ISO 12233 resolution test chart

Here is a crop of the chart illustrationg several of the hyperbolic wedges. Wedge supports horizontal and vertical wedges, but not (yet) diagonal wedges.

ISO 12233 chart crop
ISO 12233 resolution test chart crop, showing hyperbolic wedges

Hyperbolic wedges are found  in a number of other test charts, including the CIPA resolution chart, the IEEE Std 208 Video test chart (replacement for the EIA-1956 chart below), and several from Image Engineering.

Trapezoidal wedges (linear in spacing) are found in fewer charts, the most notable being the EIA-1956 video resolution test chart. A crop of the upper-right is shown below.

EIA 1956 test chart (upper-right crop)
EIA 1956 test chart (crop of upper-right)

Testing recommendations

If you are starting an image quality/resolution testing program, we strongly recommend that you consider the SFRplus module, which offers automated region selection, maps resolution (MTF) over the image surface, and measures several image quality factors from a single image.

Operation of Wedge is somewhat fussier; it requires special care in region selection (described below). To get reliable MTF measurements from standard test charts, at least two regions must be selected. These regions tend to cover a relatively large portion of the image, so there is little possibility of mapping the response over the image surface. Nevertheless Wedge has a few unique attributes:

The measurement of MTF from wedge patterns is an entirely new feature of the Imatest Wedge module. To our knowledge, no other software has this capability.

Instructions

Select the test chart. The ISO 12233 resolution test chart and its variants are by far the best-know charts with wedge patterns, but there are many others, including the EIA-1956 chart. The SVG Squares and Wedges chart, which is a Scalable Vector Graphics file that can be printed from Imatest Test Charts, contains very nice Wedge patterns.

Photograph the test chart using reasonably even (±10%) glare-free lighting. A low-cost lighting setup is described in The Imatest Test Lab. Save the image in a standard format (TIFF, BMP, PNG, high quality JPEG, etc.).

The distance to the chart is not critical. The calibration numbers next to the wedge patterns are not used by Imatest, which calculates spatial frequencies automatically. The calibration numbers are only valid when the arrowhead patterns at the top and bottom of the chart are aligned with the top and bottom of the image. (They represent spatial frequency in LW/PH when multiplied by 100.) If possible, the highest spatial frequency in the wedge patterns should be above the Nyquist frequency (0.5 cycles/pixel). This may be be difficult to achieve when the original ISO 12233 chart is used with high resolution cameras.

Open Imatest, Press Rescharts the left, then select 6. Wedge pattern in the Chart type box, below the Read image file button on the right. (If 6. Wedge pattern has already been selected, simply click on Read image file.)

Open the file to be analyzed.

Select the regions of interest ROIs) to be analyzed. Read this section carefully: Poor region selection can lead to unreliable results!

In most cases you'll need to select more than one region. Only vertical and horizontal (but not diagonal) wedges can be analyzed at this time.

Select the first region using the standard Imatest rough selection window. After you've made the selection, the fine adjust window opens.

Wedge module fine adjustment window
ROI Fine adjustment window

The boundaries of the selected region sould be inside the ends of the wedge. Wedge will usually work if the boundaries are outside, but some bad rows (or columns for horizontal wedges) may be detected if the image is unsharp. The boundaries of the selected region would be outside the sides of the wedge (the outer bars), allowing a little "breathing room". There should be no problem if the selected region includes interfering patterns (mostly horizontal lines in the above image). Wedge employs a very robust algorithm for ignoring them.

Usually more than one region needs to be selected because most wedges have a limited frequency range (100-600 LW/PH in the above image, assuming it was framed according to the ISO recommendations— unnecessary for Imatest). To select another region, click Yes, Select another region (in the yellow region, bottom-center). Referring to the ISO 12233 resolution test chart crop image, above, the first region (5 bars, labeled 1-5, with relatively low spatial frequencies) was located to the left of center. The second region should be the narrower region (9 bars, labelled 6-20, with higher spatial frequencies) to the right of the center.

In many cases two regions will be sufficient, but in the Applied Image QA-77 test chart, which is a revised version of the ISO 12233 chart with added low contrast edges, the lowest spatial frequency in the hyperbolic wedges is labeled 5, which corresponds to 500 Line Widths/Picture Height when the chart is framed according to specification. This compares to 1 (~100 LW/PH) for the old standard ISO chart. Unfortunately 500 LW/PH is not a low enough spatial frequency to reliably normalize the MTF, which is by definition 1 (100%) at low spatial frequencies. (100 LW/PH is low enough in most practical situations.)

To remedy this situation, you can enter a square region (defined by aspect ratio = height/width between 0.75 and 1.33) that contains a simple edge, half light and half dark. The edge should reasonably close to the lowest frequency portion of the wedges.

ROI repeat dialog box showing three selected regions
ROI repeat dialog box (appears when you read an image with the same pixel size as the previous image),
showing three selected regions including a square for low frequency MTF normalization.

When you have selected all the regions, press Yes, Continue or Yes, Continue in Express mode at the bottom of the ROI Fine Adjustment box. If Express mode is not selected, the input dialog box shown on the right appears. This box is also opened when you press More settings.

Wedge input dialog box
Input dialog box

Settings

Don't worry about getting all settings correct: You can always open this dialog box by clicking on More settings in the Rescharts window.

Chart type: Either Linear frequency: hyperbolic wedge or Linear spacing: trapezoidal wedge (straight lines). Select the appropriate type.

Gamma is used to linearize the test chart. It can be measured by Stepchart, Colorcheck, or Multicharts. 0.5 is a typical value for color spaces intended for display at gamma = 2 2 (sRGB, Adobe RGB, etc.).

Channel is R, G, B, or Y (luminance; the default).

Display options

Spatial frequency  Selects spatial frequency units for display (cycles/pixel, cycles/mm, cycles/in, LW/PH (Line Widths per Picture Height, where 2 Line Widths = 1 cycle or line pair), LP/PH, cycles/milliradian, or cycles/degree). If Cycles/mm, Cycles/in, or Cycles/angle are selected, the pixel spacing (pitch) in pixels per inch, pixels per mm, or microns per pixel should be entered.

Maximum x-axis frequency selects the maximum display frequency.

Secondary readout  allows up to two secondary redouts (MTFnn, MTFnnP, or MTF at a specified spatial frequency) to be displayed on the MTF plot. Details here.

After you press OK, calculations are performed and the most recently-selected display appears.

Results

The Display box in the Rescharts window, shown below, allows you to select one of two displays. Display options are set in boxes below Display. All displays have a channel selection option (Red, Green, Blue, or Luminance (Y) (0.3R + 0.59G + 0.11B).

Display Description
MTF, Aliasing, and Summary Display MTF and the onset of aliasing (called "vanishing resolution" in the CIPA DC-003 standard).
EXIF data & Moire Displays color Moiré and EXIF data, if available.
In addition to the displays, two buttons allow you to save results.
 Save screen Saves an image of the Starchart window as a PNG file. If you check Display screen in the Save screen dialog box, the image will be opened in the editor/viewer of your choice. (Irfanview works well, and it's free.)
 Save data Saves detailed results in a CSV file that can be opened by Excel and also in an XML file.

The spatial frequency is automatically calculated from the image under the assumption that

MTF and Aliasing

The image below shows results for the Canon EOS-40D, 24-70 f/2.8 lens set at 45mm, f/8, JPEG output, Standard picture style. A sequence of images were taken at different focal lengths and apertures. Rename files was used to add the key information (focal length, aperture) to the file name.

Wedge MTF and Aliasing results
MTF and Aliasing results

There is a sawtooth pattern in the MTF original (unsmoothed) plot (the thin gray dotted lines which look like a gray blur in the above image). This arises from differences in MTF between the two wedges, which have overlapping spatial frequencies. The wedges are in different portions of the image, and hence have slightly different MTF. When Wedge is run with a simulated image that has uniform signal processing, the sawtooth pattern does not appear.

Detected/total bars smoothed (thick red line) shows the onset of aliasing. The unsmoothed line is not used because it is susceptible to noise. The smoothed line is calculated from 15 adjacent (equally-weighted) values. The onset of aliasing ("vanishing resolution") is where the smoothed line drops below 0.95. It is displayed as a vertical red line at the bottom of the plot.

Color moiré

Color moire in the Canon Rebel XT
Color moiré on fabric
(Canon Rebel XT with kit lens)


Color moiré is artificial color banding that can appear in images with repetitive patterns of high spatial frequencies, like fabrics or picket fences. The example on the right is a detail of a shirt captured by the Canon Rebel XT with its excellent kit lens.

Color moiré is the result of aliasing in image sensors that employ Bayer color filter arrays, as explained below. Key points:


To the best of our knowledge there is no well-established standard for measuring color moiré. The measurement depends on the test pattern, and as a result we've had to use a slightly different measurement from the Log Frequency module. One of the parameters shown on the right, selected by the Moire box in the Plot settings area of the Rescharts window, is plotted immediately below MTF in the MTF & Moire displays. The two parameters shown in boldface, R-B and L*a*b* chroma (sqrt(a*2+b*2 )) have proven to be the most useful. A color moiré plot is shown below.

The Correct for color density checkbox, which corrects for tonal imbalances in the image, should normally be checked. The lowest frequency where moiré can be visible with Bayer sensors is 0.25 cycles/pixel, half the image Nyquist frequency. This is so because the sensor pixel spacing for the red and blue channels is twice that of the (final demosaiced) image pixel spacing. The total moiré for a selected parameter is the variation of that parameter above 0.3 cycles/pixel, shown in bold red in the plot. For the plot below, it is the maximum − minimum L*a*b* chroma (√(a*2+b*)) above 0.3 c/p = 14.9 (L*a*b* units).

R-B The most useful of the color differences
(R-B)/(R+B)  
R-G  
(R-G)/(R+G)  
G-B  
(G-B)/(G+B)  
S(HSL) Saturation in HSL color
S(HSV) Saturation in HSV color
Chroma (sqrt(a*2 + b*2)) Chroma in L*a*b* space
Color moiré measurements

Color moire and EXIF results
Color moiré and EXIF data

 

Limitations and Comparisons

A key limitation to the Wedge MTF measurement is that the results at the Nyquist frequency (and also 2/3 Nyquist) are highly sensitive to the phase of the bars relative to the pixels, i.e., to the precise sub-pixel positioning, which is difficult to control. It can be visualized as follows: At the Nyquist frequency, there are exactly two pixels per bar spacing (where by "bar spacing" we mean a complete cycle composed of a (dark) bar and the (light) interval). If the bar boundary is in the middle of a pixel, half of each pixel will be covered by the bar and half will be covered by the region between bars— MTF will be zero. If the bar boundaries corresponds to the pixel boundaries, alternate pixels will be dark and light— there will be a strong MTF. In practice this sub-pixel spacing is impossible control, so MTF at Nyquist will vary randomly from one measurement to the next.

Slanted-edge MTF results for edge between two wedges
Slanted-edge results for edge between the
two wedges

 

The beauty of the slanted-edge algorithm used in SFR and SFRplus is that is contains a distribution of sampling phases, so that the average (correct) MTF is measured at any spatial frequency. Results are not sensitive to edge location.

An obvious question is, how do Wedge results compare with Slanted-edge SFR? The comparison is easy to make because the test target contains slanted-edge charts as well as hyperbolic wedges. To make the comparison, all you need to do is click 1. Slanted-edge SFR under New analysis (same image), and select the appropriate region (a high contrast edge in this case). Results are shown on the right.

The most notable difference is that the sharpening bump, between about 600 and 1700 LW/PH, seems to be attenuated in the Wedge output. This result is quite common. We don't entirely understand the cause.

Some differences are expected because of nonlinear signal processing, which is widespread in digital cameras: most digital cameras, especially compacts, process the signal differently in the presence or absence of contrasty edges. In the presence of a contrasty edge the image is sharpened: high spatial frequencies are boosted. In the absence of a contrasty edge noise reduction is applied, i.e., the image is blurred; high spatial frequencies are attenuated. Because nonlinear processing is part of manufacturer's "secret sauce", it's difficult to predict exactly how the different methods will compare.

Here is a summary of reasons why the different charts may give different results.

Despite these factors, a reasonable match between the different methods can be obtained if nonlinear signal processing is not strong.

Calculation details

MTF is defined as the relative modulation of a sine pattern (a pattern of pure spatial frequency). To calculate MTF from the wedge, which is a bar pattern, it is treated as a square wave, which can be broken down to a fundamental frequency and harmonics by means of fourier transform analysis. (Only the fundamental is significant for MTF.) Here is the algorithm:

Smoothing.  MTF & Aliasing results consist of two curves: unsmoothed (thin dashed lines) and smoothed (thick solid lines). The smoothed curves are emphasized because the roughness in the unsmoothed curves is entirely an artifact of the calculations, resulting from sampling phase and noise— irregularities can result from noise on a single scan line. It is important to realize that the features of the unsmoothed curve have no physical meaning.

The Nyquist sampling theorem, aliasing, and color moiré

(This section was adapted from normankoren.com.)

The Nyquist sampling theorem states that if a signal is sampled at a rate dscan and is strictly band-limited at a cutoff frequency  fC  no higher than dscan/2, the original analog signal can be exactly reconstructed. The frequency fN = dscan/2 is called the Nyquist frequency. By definition  fN  is always 0.5 cycles/pixel.

The first sensor null (the frequency where a complete cycle of the signal covers one sample, hence must be zero regardless of phase) is twice the Nyquist frequency. The sensor's average sensitivity (the average of all sampling phases) at the Nyquist frequency can be quite large.

Signal energy above  fN  is aliased— it appears as artificially low frequency signals in repetitive patterns, typically visible as moiré patterns. In non-repetitive patterns aliasing appears as jagged diagonal lines— "the jaggies" (a less severe form of image degradation).  The figure below illustrates how response above the Nyquist frequency leads to aliasing.

Example of aliasing
  Signal  (3fN /2)                                                
  Sensor pixels
 
1
 
 
2
 
 
3
 
 
4
 
 
5
 
 
6
 
 
7
 
 
8
 
  Response  ( fN /2)                                                

In this simplified example, sensor pixels are shown as alternating pink and cyan zones in the middle row. By definition the Nyquist frequency is 1 cycle in 2 pixels = 0.5 cycles/pixel. The signal (top row; 3 cycles in 4 pixels) is 3/2 the Nyquist frequency, but the sensor response (bottom row) is half the Nyquist frequency (1 cycle in 4 pixels)— the wrong frequency. It is aliased.

The sensor responds to signals above Nyquist— MTF is nonzero, but because of aliasing, it is not good response.

In digital cameras with Bayer color filter arrays— sensors covered with alternating rows of RGRGRG and GBGBGB filters— the problem is compounded because the spacing between pixels of like color is significantly larger than the spacing between pixels in the final image, especially for the Red and Blue channels, where the Nyquist frequency is half that of the final image. This can result in color moiré, which can be highly visible in repetitive patterns such as fabrics. Demosaicing programs (programs that fill in the missing colors in the raw image) use sophisticated algorithms to infer missing detail in each color from detail in the other colors. These algorithms can have a significant effect on color moiré.

Bayer color filter array (CFA)
Bayer CFA

Many digital camera sensors have anti-aliasing or lowpass filters to reduce response above Nyquist. Anti-aliasing filters blur the image slightly, i.e., they reduce resolution. Sharp cutoff filters don't exist in optics as they do in electronics, so some residual aliasing remains, especially with very sharp lenses. The design of anti-aliasing filters involves a tradeoff between sharpness and aliasing (with cost thrown in).

Extreme aliasing. The now-discontinued 14-megapixel Kodak DCS 14n, Pro N, and Pro C, had no anti-aliasing filter. With sharp lenses, MTF response extended well beyond the Nyquist frequency. The 14n behaved very badly in the vicinity of Nyquist (63 lp/mm), as shown in this MTF test chart image, supplied by Sergio Lovisolo. This is about as bad as it gets.

Example of color moire

The Foveon sensor used in Sigma DSLRs is sensitive to all three colors at each pixel site. It also has no anti-aliasing filter and high MTF at Nyquist, but aliasing is far less visible because it is monochrome, not color.




Subscribe to the Imatest Newsletter