Login or Create Account

Sharpness

What is it and how is it measured?

   My Account  |  Cart Contents  |  Checkout   
Introduction The slanted-edge test for Spatial Frequency Response Calculation details Results Interpreting MTF50
See Also
Imatest SFR Tour How to test lenses with Imatest
Related
Understanding image sharpness and MTF Digital cameras vs. film The Canon EOS-10D Digital SLR Digital cameras Lens testing

Image sharpness

Sharpness is arguably the most important photographic image quality factor: it's the factor most closely related to the amount of detail an image can render. But it's not the only important factor. Others measured by Imatest include chromatic aberration (closely related to sharpness), noise, dynamic range (closely related to noise), and color accuracy.

Sharpness is defined by the boundaries between zones of different tones or colors. It is illustrated by the bar pattern of increasing spatial frequency, below. The top portion represents a target used to test a camera/lens combination. It is sharp; its boundaries are abrupt, not gradual. The bottom portion illustrates the effect of a high quality 35mm lens on a 0.5 millimeter long image of the pattern (on the film or digital sensor plane). It is blurred. All lenses, even the finest, blur images to some degree. Poor lenses blur images more than fine ones.

Bar pattern of increasing spatial frequency, showing blur

One way to measure sharpness is to use the rise distance of the edge, for example, the distance (in pixels, millimeters, or fraction of image height) for the pixel level to go from 10% to 90% of its final value. This is called the 10-90% rise distance. Although rise distance is a good indicator of image sharpness, it has one limitation. It is poorly suited for calculating the sharpness of a complete imaging system from the sharpness of its components, for example, from a lens, digital sensor, and software sharpening algorithm.

To get around this problem, measurements are made in frequency domain, where frequency is measured in cycles or line pairs per distance (typically millimeters in film measurements, but may also be inches, pixels, or image height). Line pairs per millimeter (lp/mm) is the most common spatial frequency unit for film, but cycles/pixel is convenient for digital sensors. The image below is a sine wave— a pattern of pure tones— that varies from low to high spatial frequencies, in this case from 2 to 200 lp/mm, over a distance of 0.5 millimeters. The top portion is the original sine pattern. The bottom portion illustrates the effects of the same high quality 35mm lens, which reduces pattern contrast at high spatial frequencies.

Sine pattern of increasing spatial frequency, showing blur


The relative contrast at a given spatial frequency (output contrast/input contrast) is called the Modulation Transfer Function (MTF) or Spatial Frequency Response (SFR).

Illustration of Modulation Transfer Function (MTF)
(Spatial frequency response (SFR) )

The upper plot displays the sine and bar patterns: original and after blurring by the lens.

The middle plot displays the luminance of the bar pattern after blurring by the lens (the red curve). Contrast decreases at high spatial frequencies.

The lower plot displays the corresponding MTF (SFR) curve  (the blue curve).

By definition, the low frequency MTF limit is always 1 (100%). For this lens, MTF is 50% at 61 lp/mm and 10% at 183 lp/mm.

Both frequency and MTF are displayed on logarithmic scales with exponential notation (100 = 1; 101 = 10; 102 = 100, etc.). Amplitude is displayed on a linear scale.

The beauty of using MTF (Spatial Frequency Response) is that the MTF of a complete imaging system is the product of the the MTF of its individual components.

Green is for geeks. Do you get excited by a good equation? Were you passionate about your college math classes? Then you're probably a math geek a member of a misunderstood but highly elite fellowship. The text in green is for you. If you're normal or mathematically challenged, you may skip these sections. You'll never know what you missed.
MTF is related to edge response by a mathematical operation known as the Fourier transform. MTF is the Fourier transform of the impulse response— the response to a narrow line, which is the derivative (d/dx) of the edge response. Fortunately, you don't need to understand Fourier transforms or calculus to understand MTF.

Traditional "resolution" measurements involve observing an image of a bar pattern (usually the USAF 1951 chart) on film, and looking for the highest spatial frequency (in lp/mm) where a pattern is visible. This corresponds to an MTF of about 2-5%. Because this is the spatial frequency where image information disappears— where it isn't visible, it is not a good indicator of image sharpness.

Experience has shown that the best indicators of image sharpness are the spatial frequencies where MTF is 50% of its low frequency value (MTF50) or 50% of its peak value (MTF50P).

MTF50 or MTF50P are ideal parameters for comparing the sharpness of different cameras for several reasons: (1) Image contrast is half its low frequency or peak values, hence detail is still quite visible. (2) The eye is relatively insensitive to detail at spatial frequencies where MTF is low: 10% or less. (3) The response of virtually all cameras falls off rapidly in the vicinity of MTF50 and MTF50P. MTF50P may better for oversharpened cameras that have peaks in their MTF response.

Although MTF can be estimated directly from images of sine patterns (see Rescharts Log Frequency, Log F-Contrast, and Star Chart), a sophisticated technique, based on the ISO 12233 standard, "Photography - Electronic still picture cameras - Resolution measurements," provides more accurate and repeatable results. A slanted-edge image, described below, is photographed, then analyzed by Imatest SFR or Rescharts Slanted-edge SFR. (SFR stands for Spatial Frequency Response.)

Origins of Imatest SFR  The algorithms for calculating MTF/SFR were adapted from a Matlab program, sfrmat, written by Peter Burns () to implement the ISO 12233 standard. Imatest SFR incorporates numerous improvements, including improved edge detection, better handling of lens distortion, a nicer interface, and far more detailed output. The original Matlab code is available on the I3A ISO tools download page by clicking on ISO 12233 Slant Edge Analysis Tool sfrmat 2.0. In comparing sfrmat 2.0 results with Imatest, note that if no OECF (tonal response curve) file is entered into sfrmat, it assumes that there is no tonal response curve, i.e., gamma = 1. In Imatest, gamma is set to a default value of 0.5, which is typical of digital cameras. To obtain good agreement with sfrmat, you must set gamma to 1.

The slanted-edge test for Spatial Frequency Response

Slanted-edge test charts can be created with Imatest Test Charts (SVG charts are especially recommended) or downloaded from How to test lenses with Imatest. The bitmap chart has horizontal and vertical edges for best print quality. It should be tilted (about 2-8 degrees) before it is photographed.

Imatest SFR can also take advantage of portions of the ISO 12233 test chart, shown on the right, or a derivative like the Applied Image QA-77, or as a less expensive alternative from Danes-Picta in the Czech Republic (the DCR3 chart on their Digital Imaging page)). Two such portions are indicated by the red and blue arrows. ISO 12233 charts are used in imaging-resource.com and dpreview.com digital camera reviews.

ISO 12233 chart, showing horizontal and vertical edges

A printable vector-graphics version of the ISO chart is available courtesy of Stephen H. Westin of the Cornell University Computer Graphics Department. It should be printed as large as possible (24 inches high if possible) so edge sharpness is not limited by the printer itself. (There may be some jaggedness in the slanted edges; not a problem with the recommended printable target.)

A typical portion is shown on the right: a crop of a vertical edge (slanted about 5.6 degrees), used to calculate horizontal MTF response. An advantage of the slanted edge test is that the camera-to-target distance isn't critical. It doesn't enter into the equation that converts the image into MTF response. Imatest Master can calculate MTF for edges of virtually any angle, though exact vertical, horizontal, and 45° can have numerical problems.

Slanted edge algorithm (calculation details)
The MTF calculation is derived from ISO standard 12233. Some details are contained in Peter Burns' SFRMAT 2.0 User's Guide, which can be downloaded from the I3A ISO tools download page by clicking on Slant Edge Analysis Tool sfrmat 2.0. The Imatest calculation contains a number of refinements and enhancements, including more accurate edge detection and compensation for lens distortion (which could affect MTF measurements). The original ISO calculation is performed when the ISO standard SFR checkbox in the SFR input dialog box is checked. It is normally left unchecked.
  • The cropped image is linearized, i.e., the pixel levels are adjusted to remove the gamma encoding applied by the camera. (Gamma is adjustable with a default of 0.5).
  • The edge locations for the Red, Green, Blue, and luminance channels (Y = 0.3*Red + 0.59*Green + 0.11*Blue) are determined for each scan line (horizontal lines in the above image).
  • A second order fit to the edge is calculated for each channel using polynomial regression. The second order fit removes the effects of lens distortion. In the above image, the equation would have the form, x = a0 + a1 y + a2 y2.
  • Depending on the value of the fractional part fp = xi - int(xi ) of the second order fit at each scan line, the shifted edge is added to one of four bins (bin 1 if 0 ≤ fp < 0.25; bin 2 if 0.25 ≤ fp < 0.5; bin 3 if 0.5 ≤ fp < 0.75; bin 4 if 0.75 ≤ fp < 1. (Correction 11/22/05: the bin does not depend on the detected edge location.)
  • The four bins are combined to calculate an averaged 4x oversampled edge. This allows analysis of spatial frequencies beyond the normal Nyquist frequency.
  • The derivative (d/dx) of the averaged 4x oversampled edge is calculated. A windowing function is applied to force the derivative to zero at its limits.
  • MTF is the absolute value of the Fourier transform (FFT) of the windowed derivative.

Additional details of the calculation can be found in Appendix C, Video Acquisition Measurement Methods (especially pp. 102-103), of the Public Safety SoR (Statement of Requirements) volume II v 1.0 (6 MB download), released by SAFECOM, prepared by ITS (a division of NTIA, U.S. Department of Commerce).


Imatest SFR results

35mm camera lens tests use line pairs per millimeter (lp/mm) as the units of spatial frequency. This works fine for comparing lenses because all 35mm cameras have the same 24x36 mm picture size. But digital sensor digital varies widely, from under 6 mm diagonal in ultra-compact models to 43 mm diagonal for full-frame DSLRs— even larger for medium format backs. The number of pixels also varies. For this reason, spatial frequency should be measured in units that indicate the response over the total sensor height rather than the response per distance.

For this purpose we use line widths per picture height (LW/PH). LW/PH is equal to 2 * lp/mm * (picture height in mm). Where total picture height is involved, line widths is customarily used instead of pairs (where one line pair equals two line widths).

The use of picture height gives a slight advantage to compact digital cameras, which have an aspect ratio (width:height) of 4:3, compared to 3:2 for digital SLRs. Compact digital cameras have slightly more vertical pixels for a given number of total pixels. For example, a 5.33 megapixel compact digital camera would have 2000 vertical pixels— as many as a 6 megapixel DSLR.

Another measure of spatial frequency used with digital cameras is cycles or line pairs per pixel (c/p or lp/p). This gives an indication of how well individual pixels perform. There is no need to use actual distances (millimeters or inches) to evaluate digital camera image quality, although such measurements are available in Imatest SFR.

Imatest SFR program output contains results on the left and input data on the right (a thumbnail of the entire image, the region of interest (ROI), and selected EXIF data).


Results from the ISO 1233 image for the Canon EOS-10D.

(top) A narrow image that illustrates the tones of the averaged edge. It is aligned with the edge profile (spatial domain) plot, immediately below.

(middle) Spatial domain plot:  The average edge profile (linearized, i.e., proportional to light energy). The key result is the 10-90% edge rise distance, shown in pixels and in the number of rise distances per picture height. The red values are for standardized sharpening. Other parameters include overshoot and undershoot (if applicable). This plot can optionally display the line spread function (LSF: the derivative of the edge), or the edge in pixels (gamma-encoded).

(bottom) Frequency domain plot:  The Spatial Frequency Response (MTF), shown to twice the Nyquist frequency. The key result is MTF50, the 50% MTF frequency, which corresponds to perceived image sharpness. It is given in cycles per pixel (c/p) and line widths per picture height (LW/PH). Other results include MTF at NYQ, the MTF at the Nyquist frequency (0.5 cycles/pixel; sampling rate/2), which indicates the probable severity of aliasing. The Nyquist frequency is displayed as a vertical blue line.

For this camera, which is moderately sharpened, MTF50P (only shown when Standardized sharpening display is unchecked) is identical to MTF50.

 

SFR Results: MTF (sharpness) plot describes this Figure in detail.


Interpreting MTF50

This section was written before the addition of SQF (Subjective Quality Factor) to Imatest (Ver. 2.1, November 2006).
SQF allows a more refined estimate of perceived print sharpness.

What MTF50 do you need?  It depends on print size. If you plan to print gigantic posters (20x30 inches or over), the more the merrier. Any high quality 4+ megapixel digital camera (one that produces good test results; MTF50(corr) > 0.3 cycles/pixel) is capable of producing excellent 8.5x11 inch (letter-size; A4) prints. At that size a fine DSLR wouldn't offer a large advantage in MTF. With fine lenses and careful technique (a different RAW converter from Canon's and a little extra sharpening), my 6.3 megapixel Canon EOS-10D (corrected MTF50 = 1340 LW/PH) makes very good 12x18 inch prints (excellent if you don't view them too closely). Prints are sharp from normal viewing distances, but pixels are visible under a magnifier or loupe; the prints are not as sharp as the Epson 2200 printer is capable of producing. Softness or pixellation would be visible on 16x24 inch enlargements. The EOS-20D has a slight edge at 12x18 inches; it's about as sharp as I could ask for. There's little reason go go to a 12+ megapixel camera lie the EOS 5D, unless you plan to print larger. Sharpness comparisons contains tables, derived from images downloaded from two well-known websites, that compare a number of digital cameras. Several outperform the 10D.

The table below is an approximate guide to quality requirements. The equation for the left column is

MTF50(Line Widths / inch on the print) =
    MTF50(LW/PH)     
Print height in inches

MTF50 in
Line Widths/inch
on the print
Quality level— after post-processing, which may include some additional sharpening
150 Excellent— Extremely sharp at any viewing distance. About as sharp as most inkjet printers can print.
110 Very good— Large prints (A3 or 13x19 inch) look excellent, though they won't look perfect under a magnifier. Small prints still look very good.
80 Good— Large prints look OK when viewed from normal distances, but somewhat soft when examined closely. Small prints look soft adequate, perhaps, for the "average" consumer, but definitely not "crisp."

Example of using the table: My Canon EOS-10D has MTF50 = 1335 LW/PH (corrected; with standardized sharpening). When I make a 12.3 inch high print on 13x19 inch paper, MTF50 is 1335/12.3 = 108 LW/in: "very good" quality; fine for a print that size. Prints look excellent at normal viewing distances for a print this size.

This approach is more accurate than tables based on pixel count (PPI) alone (though less refined than SQF, below). Pixel count is scaled differently; the numbers are around double the MTF50 numbers. The EOS-10D has 2048/12.3 = 167 pixels per inch (PPI) at this magnification. This table should not be taken as gospel: it was first published in October 2004, bandit may be adjusted in the future.

Subjective Quality Factor (SQF)

SQF for EOS-10D

MTF is a measure of device or system sharpness, only indirectly related to the sharpness perceived when viewing a print. A more refined estimate of perceived print sharpness must include assumptions about viewing distance (typically proportional to the square root of print height) and the human visual system (the human eye's Contrast Sensitivity Function (CSF)). Such an formula, called Subjective Quality Factor (SQF) was developed by Eastman Kodak scientists in 1972. It has been verified and used inside Kodak and Polaroid, but it has remained obscure until now because it was difficult to calculate. Its only significant public exposure has been in Popular Photography lens tests. SQF was added to Imatest in October 2006.

A portion of the Imatest SFR SQF figure for the EOS-10D is shown on the right. SQF is plotted as a function of print size. Viewing distance (pale blue dashes, with scale on the right) is assumed to be proportional to the square root of picture height. SQF is shown with and without standardized sharpening. (They are very close, which is somewhat unusual.) SQF is extremely sensitive to sharpening, as you would expect since sharpening is applied to improve perceptual sharpness.

The table below compares SQF for the EOS-10D with the MTF50 from the table above.

MTF50 in
Line Widths/inch
on the print
Corresponding print height for the EOS-10D (MTF50 = 1335 LW/PH) SQF at this print height Quality level— after post-processing, which may include some additional sharpening. Overall impression from viewing images at normal distances as well as close up.
150 8.9 inches = 22.6 cm 93 Excellent— Extremely sharp.
110 12.1 inches = 30.8 cm 90 Very good.
80 16.7 inches = 42.4 cm 86 Good— Very good at normal viewing distance for a print of this size, but visibly soft on close examination.

An interpretation of SQF is give here. Generally, 90-100 is considered excellent, 80-90 is very good, 70-80 is good, and 60-70 is fair. These numbers (which may be changed as more data becomes available) are the result of "normal" observers viewing prints at normal distances (e.g.., 30-34 cm (12-13 inches) for 10 cm (4 inch) high prints). The judgments in the table above are a bit more stringent— the result of critical examination by a serious photographer. They correspond more closely to the "normal" interpretation of SQF when the viewing distance is proportional to the cube root of print height (SQF = 90, 86, and 80, respectively), i.e., prints are examined more closely than the standard square root assumption.

An SQF peak over about 105 may indicate oversharpening (strong halos near edges), which can degrade image quality. SQF measurements are more valid when oversharpening is removed, which is accomplished with standardized sharpening.

Some observations on sharpness

The ideal response would have high MTF below the Nyquist frequency and low MTF at and above it.

Links

Bob Atkins has an excellent introduction to MTF and SQF. SQF (subjective quality factor) is a measure of perceived print sharpness that incorporates the contrast sensitivity function (CSF) of the human eye. It will be added to Imatest Master in late October 2006.

This page has some interesting material on Fuji sensors and the history of the slanted-edge test.

Spatial Frequency Response of Color Image Sensors: Bayer Color Filters and Foveon X3 by Paul M. Hubel, John Liu and Rudolph J. Guttosch, Foveon, Inc., Santa Clara, California.  Uses slanted edge testing.

Optikos makes instruments for measuring lens MTF. Their 64 page PDF document, How to Measure MTF and other Properties of Lenses, is of particular interest.

Zeiss makes instruments for measuring MTF. You can't deep link to their site; you must go to the North America page, click on Camera/Cine Lenses in the dropdown menu, then search for MTF. The MTF-Tester K8 is used for many manufacturer's lens tests.