Slanted Line Tests on the Canon SX30
Slanted line tests (as opposed to slanted edge tests) were performed on the Canon SX30. The tests were used to produce plots of the Modulation Transfer Function (MTF) as a function of spatial frequency. This function is also called the Spatial Frequency Response (SFR). The measurements are compared with a simple model of the lens and sensor.
The Slanted Edge Test is a method of measuring the Modulation Transfer Function (MTF) of a lens-camera system as a function of spatial frequency. MTF is a also called Spatial Frequency Response (SFR). I tried Googling "slanted edge test" with the names of various bridge cameras (Canon SX30, SX40, SX50 Panasonic FZ200 etc.) with no results, so I decide to test my Canon SX30. In order to make this an interesting and educational project, I decided that I would make my own targets and do my own analysis using only PhotoShop Elements 9 and Microsoft Excel spreadsheet. Several websites provided useful information about slanted edge tests: Imatest (Norman Koren) [1,2,2b] and Quick MTF (Oleg Kurtsev) [3,4] sell targets and software, while MTF Mapper (Frans van den Bergh) provides both free [5,6]. The reason for using a slanted edge is to sample the brightness of pixels at distance increments of less than one pixel (in the perpendicular direction, from the edge). This is illustrated by Kerr  and also by van den Bergh  (file "se_method.pdf"). In my tests, I used an angle of 5.71 degrees away from vertical. This angle is commonly used because its tangent is equal to 0.1 and allows sampling slightly less than every 0.1 pixel.
Target Alignment: Extra lighting and careful alignment of the camera's EVF or LCD grid-lines with the guidelines on the target made evaluation of the angle by edge detection unnecessary.
Printed Slanted Edge Targets
I tried various types of slanted edge targets. To make printed targets, I painted a black-white edge using PhotoShop and printed it. Imatest  has very useful tips about testing: in particular, avoiding clipping and the use of high-contrast targets. So I made more slanted-edge targets using various contrast ratios. Because of dots in the laser printing, I had to use large target distances (15 m outdoor tests). The problems looked less pronounced using targets with a 5:1 contrast ratio (pixel brightnesses 42 and 213 in PhotoShop), but it seemed more like a disguise of the problem than a solution.
Blackened-Razor Slanted Edge Target
Frans van den Bergh, in his MTF Mapper blogspot , describes his "death star" for producing uniform diffuse lighting of a razor blade that has been blackened by candle soot.
|Fig. 1: Slanted Edge Test Using a Blackened Razor Blade and Corresponding Edge Spread Function (ESF)|
Fig. 1 is a typical example of my cropped photos of the slanted razor edge and Edge Spread Function (ESF), which is simply a plot of the average intensity that you see, in a direction perpendicular to the edge. This ESF is actually quite instructive because it relates to features that we see in photographs. For example, in the ESF plot, there appears to be a lot of rubble at the bottom of a cliff. This means that the pixels are not as black there as they should be. In the photo, this looks like faint white halos on the dark side of the edge. In the ESF plot, there is also a sharp peak at the top of the cliff. In the photo, this is seen as a white edge that is too bright. Just to the right of the sharp peak there is a hint of a slight shallow dip, which is more prominent in some of my tests. In the photo, this is seen as a slightly dark band just to the right of the band that is too bright. These features will be familiar to anybody who has taken shots of the moon . When these shots are blown up, you see the same halos in the sky next to the edge of the moon and the same overly-bright edge of the moon. I have encountered the same problems with my closeup shots and sometimes spend hours removing the halos [Figs. 6 & 7 of Ref. 8, although some of these halos are motion-induced from focus-stacking]. I don't know whether or not halo problems are worse in my SX30, with its CCD sensor, than in other cameras, but I have seen similar halos at the high-contrast edges in macro-photographs posted online, using good quality SLRs and lenses, although the problem appears to be less prominent than here. Searching online, I find occasional mention of problems with high-contrast edges, but I have not found any detailed discussion of the root cause.
Ideally, the ESF should have a smooth antisymmetric shape, like the dashed-line Fermi function that is fitted to the test data in Fig. 1 . The steepness of the dashed curve was adjusted to give an MTF curve with an MTF of approximately 9% at 0.31 c/px, to correspond with my tests using the USAF 1951 test chart for the same focal length and aperture. Comparison with the measured ESF shows that it is too steep, which leads to resolution measurements that are better than actual values.
Measuring Pixel Brightness
Reference  gives an overview of the various methods of computing brightness. Imatest [2b] and Quickmtf  offer two options for computing pixel brightness from the brightness of the individual red green and blue channel brightnesses (Standards ITU-R BT.601 and ITU-R BT.709). Both standards weight the green channel most heavily (and the Bayer Array on the camera sensor has twice as many green pixels as red or blue). BT.601 weights the green at 57.8% of the total and BT.709 weights the green at 71.5% of the total.
My method of obtaining the brightness of pixels was to use the Colour Picker in PhotoShop Elements 9, clicking on each pixel individually. This is a tedious procedure that takes me about 1.5 hours per test just to enter the data. The Colour Picker's "brightness" value is not suitable because it is simply the maximum of the three colour channels, expressed as a percent. I had noticed that some people were posting test results online that were based on the green channel and some Imatest results , show that the green channel gives results that are very close to those with the colours weighted according to standards (much closer than the red and blue channels). As a result of this, I used the green channel in Colour Picker, which gives brightness readings from 0 to 255. Gamma is discussed in [1-2b], but PhotoShop's channel brightnesses in Colour Picker correspond to what is seen on the monitor (rather than the gamma of the JPEG file) and so the brightness numbers correspond to gamma = 1 and no further adjustment was required.
Imatest recommends using RAW or high-quality JPEG. In my tests, using "L-format" (maximum number of pixels), the JPEG quality is already set high. I used Canon's Image Browser to crop 30 x 60 pixel files, which were saved for analysis. Use of RAW files probably has some advantages over JPEG, but I do not have the software for analyzing RAW. In some photographs (e.g. Fig. 1), you can sometimes notice the 8x8-pixel JPEG blocks. The JPEG compression must have some effect on the MTF but I have not investigated this.
Obtaining the Line Spread Function (LSF) by Direct Measurement
There are two reasons that I gave up on ESF measurements:
- I was not sure how to eliminate the artifacts in the ESF that make it so steep and lead to an MTF that indicates better-than-actual resolution.
- I was having trouble differentiating the ESF to obtain the LSF. I tried several numerical methods, such as the Savitzky-Golay differentiation , but all of them gave me very noisy derivatives, possibly because my sample size is so small. (Imatest recommends 60 pixels across the edge by 80 pixels along the edge. My samples were 30x 60 pixels, but in most of my analyses, I used only 30x20).
A few on-line sites mentioned the possibility of measuring the Point Spread Function (PSF) and the Line Spread Function (LSF) directly [Slide #15b of Ref. 12], but I could find no details about how to perform the measurements and no examples of anybody actually using them to test camera lenses. Nevertheless, I decided to try it by using two blackened razors to make a narrow slit. My first attempt was a failure because the slit became clogged with soot particles from the candle flame, so I decided to try it without blackening and to do the testing in a dark room. Fig 2. shows the target, made of two razor blades taped to a ripped-off book-cover (with a hole behind the razor slit). The right side of Fig 2. show a magnified view of the slit, taken with the SX30 at full optical zoom and the Raynox 250 closeup lens. The image is from 7 shots 0.2 mm apart, focus-stacked using Zerene Stacker. Each line on the reticle is 0.1 mm (100 microns). By scaling the image on my computer monitor, I determined the slit width to be 0.018 +/- 0.002 mm (18 +/- 2 microns). After performing the tests for this article, I attempted to blacken the razor blades with candle soot and ruined the target.
|Fig. 2: Slanted Line Target (Two Razor Blades forming an 18 Micron Slit)|
Lighting For the Slanted Line Test: For lighting, I used a 26W (100W-equivalent) Noma mini-spiral soft-white bulb, placed about 5 cm behind the slit, with a piece of white paper half-way between to diffuse the light. The light balance on the camera was set to "tungsten" as that seemed to give a much more neutral colour than "fluorescent".
Camera Settings for the Slanted Line Test: Some shots were taken of the slanted line target to determine the effect of the camera's contrast, sharpness and saturation settings. (The default setting is "middle".) Fig. 3 shows two of the results. In the top test, contrast and sharpness are both set to minimum. White halos and a dark band can be seen in the photo and in the LSF. Increasing the contrast (not shown here) increased the height of the central peak and depressed the background in the raw data, but made no significant difference to the LSF because its background is zeroed and the area under the curve is normalized to one unit or 100%. (The negative portions contribute negative area.) Decreasing the saturation had negligible effect because saturation is a property of colours so that greyscale has no saturation. There were very minor changes because some slight coloration can be seen in the photo. The bottom test in Fig. 3 shows the effect of increasing the sharpness to "middle". The white halos are narrower than before, but much more pronounced, as are the dark bands on both sides of the central peak. My remaining tests were made with sharpening set to minimum in order to minimize halos. Timer: The camera's timer was set to 2 seconds to avoid vibration.
|Fig. 3: Line Spread Function without Sharpening (top) and with Sharpening (bottom)|
Slanted Line Tests at Focal Length 4.3 mm and Distance 1.6 m
Test Shots at Focal Length 4.3 mm and Distance 1.6 m
Fig. 4 shows a set of 3 test shots at focal length 4.3 mm (the minimum zoom of the SX30). The tests are at f/2.7, f/5.6 and f/8.0. It is clear that the resolution gets worse as the f-number increases. That is, the width of the image widens as the aperture diameter narrows. The effect is quite dramatic if the 3 images are viewed one at a time in succession.
|Fig. 4: Images of Slanted Line for f/2.7, f/5.6 & f/8.0 for Focal Length 4.3 mm and Distance 1.6 m|
Line Spread Functions at Focal Length 4.3 mm and Distance 1.6 m
Fig. 5 shows the LSFs of the three test shots in Fig. 4. The same widening effect with increase of f-number is evident. The red line is the smoothed LSF, using the Savitzky-Golay 9-point smoothing filter . The smoothed version of the SLF was Fourier transformed to obtain the MTF. Analysis in the appendix shows that the finite width of the slit does not contribute significantly to the width of the LSF or to MTF values.
|Fig. 5: Line Spread Functions (LSFs) at f = 4.3 mm Corresponding to Test Shots in Fig. 4|
The secondary peaks on both sides of the main peak correspond to halos in Fig. 4. The halos are brightest and most localized at f/2.7, but their height is approximately 1/10 the height of the main peak at all three f-numbers. Reference  calls the secondary peaks "humps" and discusses their relation to the degree of sharpening. The halos do not change location with F-number and therefore appear to be mostly unrelated to diffraction.
Modulation Transfer Function (MTF) at Focal Length 4.3 mm and Distance 1.6 m
The Modulation Transfer Function (MTF) or Spatial Frequency Response (SFR) is a measure of contrast, as a function of spatial frequency of a target that varies sinusoidally in brightness. The MTF is obtained by taking a Fourier transform of the normalized LSF.
Normalization of the LSF: The LSFs shown here have been normalized  by multiplying all of the intensities by a factor that makes the MTF equal to 100% at zero frequency.
Fourier Transform: Since the Microsoft Excel spreadsheet no longer includes a Fourier transform I wrote one (using lots of rows and columns, rather than a “macro”). Fig. 6. shows the MTFs corresponding to Figs. 4 and 5.
|Fig. 6. MTFs at f = 4.3 mm Corresponding to Figs. 4 and 5|
At f/2.7, the measured MTF curve is considerably lower than the model of lens & sensor (red line) predicts. When the OLPF is included (purple line), with an offset of d = 0.35 to bring the MTF value down to approximately 10% at the Nyquist frequency, it brings the model into closer agreement with the measured curve. The green line is proposed as the MTF of the Bayer Array and demosaicing algorithm and is described in the Appendix. It was fitted to this test at f/2.7 so that the Total MTF (the blue line, which is the product of the purple and green lines) fits the measured MTF at frequencies approaching the Nyquist frequency of 0.5 c/px. The same OLPF and Bayer-Demosaic MTFs that were fitted to this test at f/2.7 are used for all three tests in this article.
At f/5.6, there is less low-frequency discrepancy between measured and modelled MTFs than at f/2.7. The OLPF actually increases the discrepancy somewhat, but the Bayer-demosaic MTF, which affects mostly high frequencies, has little effect because the lens MTF curve has lower frequencies for f/5.6 than for f/2.7. Where the measured curve rises above the model curves, this cannot be interpreted as extra resolution.
At f/8.0, there is even less low-frequency discrepancy between measured and modelled MTFs than at f/5.6, although the measured values at high frequencies are still higher than the model. The corresponding frequency is therefore better than the actual resolution. At the low frequency values for f/8.0, the Bayer & demosaicing MTF is so high that the lens-sensor-OLPF MTF (purple) almost coincides with the Total MTF (blue).
Slanted Line Tests at Focal Length 150.5 mm and Distance 10 m
Fig. 7 shows two test shots at focal length 150.5 mm (the maximum zoom of the SX30). The tests are at f/5.8 and f/8.0. Again, the resolution gets worse as the f-number increases. The halos are much more pronounced and asymmetric than they were at focal length 4.3 mm.
|Fig. 7: Images of Slanted Line for f/5.8 & f/8.0 for Focal Length 150.5 mm and Distance 10 m|
|Fig. 8: LSFs for f/5.8 & f/8.0 for Focal Length 150.5 mm and Distance 10 m|
|Fig. 9: MTFs for f/5.8 & f/8.0 for Focal Length 150.5 mm and Distance 10 m|
At f/5.8, the narrowest aperture at 150.5 mm, the MTF dropped off at low frequency and remained lower than the model. At f/8.0, there was spurious resolution, which was a little worse than at f/8.0 at focal length 4.3 mm. There was some clipping on the left side of the LSF at f/8.0. Artificially rounding the left dip down to -3% had only a minor effect on the MTF.
Lens aberration is discussed in [2b], with the comment that, "Aberration correction is the primary purpose of sophisticated lens design and manufacturing; It’s what distinguishes excellent from mediocre optical design. Lens aberrations tend to be worst at large apertures (small f-numbers). Aberrations vary greatly for different lenses (and even among of different samples of the same lens); quality control of mass-produced lenses is often quite sloppy." My tests are consistent with the comment about large apertures. Reference  states that. "In general, aberrations attenuate MTF, narrow curve, lower cutoff frequency." An accompanying sketch illustrates the MTF with aberrations that cause it to drop off rapidly at low frequency to values below the "diffraction-limited" MTF.
Halos are worst at extremes of the zoom range, at wide aperture and with sharpening . The fact that the halos do not move outwards with increasing f-numbers indicates that a large component of them is not caused by diffraction. References [3 & 14] discuss sharpening and how it can cause halos. The SX 30 has 5 sharpening levels, with the default value in the middle. For the tests in this article, sharpening is set to minimum (except for the lower part of Fig. 3). I don't know whether or not the minimum sharpening means no sharpening at all. For the test at f/2.7, I tried removing the halos in the LSF by setting their intensities to zero in the spreadsheet. The result was a marked improvement in the low-frequency MTF and much better agreement with the model. Zeiss  confirms that even a small halo corresponds to a decrease of MTF at low frequency. They do not state what the root cause of the halo is.
Apparent resolution that occurs above the cutoff frequency of the lens is sometimes called "spurious resolution". This is described and illustrated by photographs and graphs in References [15-17]. Reference [2b] states that "Lens MTF response can never exceed the diffraction limited response, but system MTF response often exceeds it at medium spatial frequencies as a result of sharpening, which is (and should be) present in most digital imaging systems."
- Measured Resolution (near 10% MTF) differs somewhat from model values:
- At wide apertures, measured MTF was lower than modelled. Some of the references suggest lens aberrations as a possible cause.
- At narrow apertures, the MTF was higher than modelled ("spurious resolution"), possibly caused by sharpening, although the camera was set to minimum sharpening.
- Halos: The original purpose of these tests was to measure resolution, but my attention soon focused on the halos. Halos have been a problem for me in high-contrast telephoto and closeup photos. These tests show that halos are present in the Line Spread Function (LSF) and are a camera property. The halos are worst at extremes of the zoom range and at the widest apertures, just as lens aberrations are worst under the same conditions. Also the halos appear to be directly responsible for a loss of contrast at low frequency, an effect that is normally attributed to lens aberrations. These facts lead me to suspect that the halos may be caused, not just by sharpening, but also by aberrations. Some possible causes of halos are:
- sharpening, although this was set to minimum. Sharpening is the only cause that I have found in references.
- diffraction, but only partly, because the halos do not change location with aperture size, as expected for diffraction
- lens aberrations or reflections
- sensor properties
- Setting sharpening to the minimum setting can help to reduce halos.
- Testing without purchasing analysis software is tedious and time-consuming.
- A slanted line target is a viable method for testing lens-camera systems.
- An interplay of testing and modelling is helpful for understanding lens-camera systems.
- Tentative values were assigned to the parameters of the Optical Low-Pass Filter (OLPF) and of the Bayer Array together with the demosaicing algorithm. More testing is required to pin down these values.
I would like to thank all the people I have referenced for a good start to my education in the testing and modelling of cameras. In particular, the following people have been most generous in providing useful information:
- Norman Koren, through his tutorials and documentation of Imatest software, which were an essential guide to my testing and analysis.
- Detail Man (posting in DPReview's Panasonic Talk Forum) for his patient private correspondence regarding modelling and for the use of his MTF spreadsheet.
- Frans van den Bergh with his inspiring "death star" and understanding of the operation and modelling of the Optical Low-Pass Filter (OLPF).
 How to Test Lenses with SFRplus, Norman Koren: http://www.imatest.com/docs/lens_testing/
 Validating the Imatest Slanted-Edge Calculation, Norman Koren: http://www.imatest.com/docs/validating_slanted_edge/
[2b] Sharpness: What is it and how is it measured?, Norman Koren: http://www.imatest.com/docs/sharpness/
 Resolution and MTF, Oleg Kurtsev: http://www.quickmtf.com/about-resolution.html
 Basic Steps in Calculating the MTF (SFR), Oleg Kurtsev: http://www.quickmtf.com/slantededge.html
 MTF Mapper, Frans van den Bergh: http://sourceforge.net/projects/mtfmapper/
 MTF Mapper Blogspot, Frans van den Bergh: http://mtfmapper.blogspot.ca/
 Determining MTF with a Slant Edge Test, Douglas A. Kerr: http://dougkerr.net/Pumpkin/articles/MTF_Slant_Edge.pdf
 Focus-Bracketing Scripts for "Macro" Setting and for Closeup Lenses, Stephen Barrett: http://www.dpreview.com/articles/9780512447/focus-bracketing-scripts-for-macro-setting-and-for-closeup-lenses
 Measurement of the spatial frequency response (SFR) of digital still-picture cameras using a modified slanted edge method,
Wei-Feng Hsu, Yun-Chiang Hsu, and Kai-Wei Chuang: http://www.dtic.mil/dtic/tr/fulltext/u2/p011345.pdf
 Brightness Calculation in Digital Image Processing, Sergey Bezryadin, Pavel Bourov, Dmitry Ilinih:
 Savitzky-Golay filter for smoothing and differentiation: http://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_smoothing_filter
 Imaging Systems Analysis II: Resolution, MTF and Spatial Artifacts, Lecture 1: Introduction, J. Verwerda: ftp://saturn.cis.rit.edu/mcsl/jaf/tenure/courses/1051-452_ISA_II/lectures/0109_introduction.pdf
Slide #15b: Measuring MTFs of optical systems: "differences in flux, generality, ease of production"
 Normalization of the modulation transfer function: The open-field approach, S. N. Friedman:
 Introduction to Sharpening, Imatest: http://www.imatest.com/docs/sharpening/
 Spurious Resolution, Paul van Walree: http://toothwalker.org/optics/spurious.html
 Modulation Transfer Function - what is it and why does it matter?, Bob Atkins, April, 2007,
 MTFs of Optical Imaging Systems Lecture 5, J. Verwerda (Sketch in Slide #17):
 How to Read MTF Curves, H. H. Nasse:
 Halos at the Edge of the Moon, Stephen Barrett, http://www.dpreview.com/forums/post/52569931
Appendix: MTF Model
A1) Pixel Pitch and Nyquist frequency in lp/mm
The Nyquist frequency in lp/mm is 0.5 c/px divided by the pixel pitch:
TABLE A1: Pixel Pitch and Nyquist Frequency
|Canon SX30 (14 MP 1/2.3" CCD)||6.17||4,320||0.00143||350|
|Canon EOS 700D (T5i) Compact SLR (16 MP APSC)||22.3||5,184||0.00430||116|
Much effort goes into the design of SLR lenses to keep contrast values higher than 50% MTF at frequencies up to 30 lp/mm whereas, with bridge cameras, there appears to be more emphasis on resolution (200 lp/mm or more near 10% MTF). Full-frame and Compact SLRs cannot reach these high frequency values.
A2) MTF of the Sensor
The MTF for an idealized monochromatic square-pixel sensor is given by the sinc function [A1]:
MTF_Ideal-Sensor = Abs[ sin( pi f ) / ( pi f ) ] (1)
Where f is in cycles per pixel.
f = 0.50 c/px is the Nyquist Frequency, for which MTF = 64%, and above which there are aliasing problems.
A3) MTF of the Lens
The frequency f, in c/px, that is used for the sensor is converted to frequency v, in lp/mm, for the lens.
The spatial frequency v is given by:
v = f / Pixel_Pitch (2)
The diffraction cutoff frequency (where MTF = 0), is defined as:
v_cutoff = [1/(lambda N)] (3)
lambda = 0.000555 mm (to represent white light)
N is the f-stop number
v_cutoff is in lp/mm
For f/2.7, v_cutoff = 667 lp/mm (Maximum aperture of SX30 at low zoom)
For f/5.8, v_cutoff = 311 lp/mm (Maximum aperture of SX30 at full optical zoom)
For f/8.0, v_cutoff = 225 lp/mm
The dimensionless frequency for the lens is given by:
s = v/v_cutoff (4)
The MTF for a perfect lens [A2] is:
MTF_Perfect-Lens(s) = 2/pi (arccos(s) - s sqrt(1-s2 )) for s < 1 (5)
= 0 for s >= 1
A4) MTF of the Optical Low-Pass Filter (OLPF)
The OLPF is also known as the anti-aliasing filter or AA-filter. Above the Nyquist frequency, if the MTF exceeds more than a few percent, this can result in Moiré patterns, particularly coloured ones in photos. The OLPF is intended to prevent this from happening. This filter consists of a birefringent coating on the surface of the sensor, which splits each incoming ray of light into two or four beams that are offset from the original one by a fraction of a pixel. This spreading out of the light necessarily slightly reduces the resolution at high frequencies. I do not know whether or not the sensors of bridge cameras have an OLPF, but I have assumed that the SX30 has an OLPF with the relatively strong offset value of d = 0.35 in order to bring the MTF value at f/2.7 in Fig. 6 down to approximately 10% MTF, in order to prevent aliasing. I have represented the Bayer Array (and its accompanying demosaicing algorithm) by an MTF which drops fairly steeply once a particular frequency is reached. My measurements are not refined enough to disentangle the effects of an OLPF (if present) from the effect of the Bayer Array, so the parameters that I have chosen for both MTFs may be quite inaccurate. Their combined effect, though, appears to be fairly realistic.
The offset parameter d is the amount that each incoming ray of light is displaced. For example, for a 4-way OLPF, d = 0.35 means that an incoming ray is split into four rays that are all displaced in four directions by 0.35 of a pixel from the original incoming ray.
For a 4-way OLPF, the MTF is given by:
MTF_OLPF = cos(2 pi d f) d < 0.5 (6)
I derived this expression by using the convolution method described by Frans van den Bergh in [A1], but it is also simply the Fourier transform of a pair of delta functions that are displaced by amounts +/-d. In [A3], Detail Man, in a discussion with Frans, posted an expression for the MTF of the sensor and OLPF combined (modifying Frans' version from earlier in the same thread). The product of Eq'ns 1 & 6 is identical to his. Actually, Equations 1 and 6 ought to be multiplied together before taking the absolute value of their product, but the latter never goes negative anyway for f < 0.5 and d < 0.5. In reference [A4], Norman Koren explains the principle behind how the absolute-value functions are placed: "Because of phase effects implicit in OTF, the combined diffraction and focus error is not the product of the OTF's for diffraction and misfocus. (You can multiply MTF's for separate components, e.g., lens and film, because phase is lost when you go from one to another.)"
A5) MTF of the Bayer Array and Demosaicing Algorithm
This part of the model is not a physical model, based on how the Bayer array operates, or on any information about the demosaicing algorithm used in the Canon SX30, which is proprietary information. This MTF is just a crude description of how I imagine the MTF would behave. The concept is simply that, at low spatial frequencies, the array and the algorithm do a good job of retaining contrast but, at some higher frequency, the array and algorithm will gradually reduce the contrast. To describe this, we require a function that starts at 100% MTF at low frequency and drops off at some specified higher frequency at a specified rate. Norman Koren provides just such a function in a tutorial [A5] to describe a lens. The same function is used here, but to describe only the effect of the Bayer Array and the demosaicing algorithm:
MTF_Bayer-Demosaic = 1 / [ 1 + (f/f50)^n ] (7)
The two parameters f50 and n were adjusted so that the total MTF matched measured high-frequency values for the case of f = 4.3 mm @ f/2.7. The fitted parameters were f50 = 0.45 and n = 8. (A slightly better fit to the other tests can be obtained by setting d = 0 for the OLPF and using f50 = 0.40 and n = 8 for Bayer-Demosaic but I did not use this, as it assumes that the demosaicing algorithm can do the job of an anti-aliasing filter.)
A6) Total MTF of the Whole Lens-Camera Imaging System
For this article, the total MTF is given by:
MTF_Total = MTF_Lens x MTF_Sensor x MTF_OLPF x MTF_Bayer-Demosaic (8)
The sensor factor has no free parameters. The lens factor depends on wavelength, which is usually 0.000555 mm and on the aperture, N in Equation 3, so there are no free parameters there either. So, the only fitted parameters in this simple "model" are the offset of 0.35 for the OLPF and the two parameters describing the Bayer Array and demosaicing algorithm. Figure A1 illustrates the individual MTF components for the SX30.
|Fig. A1: Components of the MTF Model|
*The MTFs for the OLPF and for the Bayer array & demosaicing algorithm are for the SX30.
Their parameters may be different for other types of camera.
A7) MTF of the Slanted Line Target
W is the width of the slanted line on the target, measured in mm or microns.
The width, w, of the slanted line's image on the sensor, before considering the effects of diffraction and pixel size is given by:
w = m W / (pixel_pitch) (9)
w is in units of (a fraction of a) pixel, where:
m is the measured magnification
pixel_pitch is measured in the same units as W.
In the spatial domain, the slit's LSF is convolved with the LSF of the rest of the imaging system. The variance of the slit is given by w^2 / 12. If this is added to the variance, sigma^2, of the LSF for a target of zero line-width, the variance of the LSF for a target of finite line-width is given by the sum of the two variances. If the standard deviation is used as a measure of the PSF's width, then the effect is to increase it from sigma to sqrt(sigma^2 + w^2 / 12).
In the spatial frequency domain, the MTF of the (slit convolved with the rest of the system) is equal to the product of the slit's MTF and that of the rest of the system.
The MTF of the target or, more precisely its ideal image on the sensor, is given by:
MTF_Target = Abs[ sin( pi w f ) / ( pi w f ) ]
~ 1 - ( pi w f )^2 / 6 for w < 0.2 (approx.) (10)
Table A2: Calculations of MTF_Target for my Test Conditions
at Nyquist f =0.5
|4.3 mm; f/2.7 @ 1.6 m||0.00264||0.0332||0.9995|
|150.5 mm; f/5.8 @ 10 m||0.0130||0.164||0.989|
W = 18 microns
pixel-pitch = 1.43 microns for Canon SX30
MTF_Target is not a part of modelling the MTF of the lens camera system and is therefore not included as a factor in Eq'n 8. If the effect of the target's MTF is significant, it can be used to correct the measured MTF by dividing it by MTF_Target :
Corrected MTF_Measured = Original MTF_Measured / MTF_Target 
The correction makes it as though the measured MTF had been performed with a zero-width slanted-line target. It can be seen from Table A2 that the correction is negligible for the f = 4.3 mm tests @ 1.6 m. Even for the f = 150.5 mm tests @ 10 m, the correction is very small. If the measured MTF at the Nyquist frequency is 9%, it gets corrected to 9% / 0.989 = 9.1% MTF
References for Appendix
[A1] Pixels, AA filters, Box filters and MTF, Frans van den Bergh, May 27, 2012;
[A2] Sharpness: What is it and how is it measured?, Norman Koren:
[A3] Number of Sample Points, Detail Man in reply to Frans van den Bergh:
[A4] Understanding Image Sharpness part 6: Depth of Field and Diffraction, Norman Koren
[A5] Understanding Image Sharpness Part 1A: Resolution and MTF Curves in Film and Lenses, Norman Koren, http://www.normankoren.com/Tutorials/MTF1A.html
The views and opinions expressed in this article are those of the author and do not necessarily reflect the views and opinions held by dpreview.com or any affiliated companies.