Running SFRplus (Interactive and Auto mode settings)
Imatest SFRplus performs highly automated measurements of several key image quality factors using a specially-designed test chart. This document shows how to run SFRplus in Rescharts and how to save settings for automated runs. Part 1 introduced SFRplus and explained how to obtain and photograph the chart. Part 3 illustrates the results.
|New in Imatest 3.10 SFRplus settings can be updated by clicking Settings, SFRplus Auto settings in the Imatest main window without having to read an image file into Rescharts SFRplus Setup.
New in Imatest 3.9 SFRplus can be run without including the top and bottom bars by setting the row detection to Auto – no bars. Pre-distorted SFRplus charts are available for testing fisheye (extremely barrel-distorted) lenses. An Edge ID file can be read to allow any edges to be selected.
- the Desktop,
- the Windows Start menu,
- the Imatest folder (typically C:Program filesImatestMaster (or …Image Sensor, etc.) in English language installations).
SFRplus operates in two modes: interactive/setup and automatic.
Press SFRplus run (in Rescharts). opens a dialog box for reading an SFRplus file; is more general; it lets you open any Rescharts module. Either of these buttons allows you to analyze an SFRplus image, examine detailed results interactively, and save settings for the highly automated runs (or the even more automated Imatest IT EXE or DLL versions). SFRplus should be run at least once interactively prior to the first run. SFRplus settings can also be updated by pressing Settings, SFRplus Auto settings from the Imatest main window.or then 2. SFRplus to initiate an interactive/setup
The portion of the Rescharts window used for opening files is shown on the right. You can open a file by clicking onif the correct chart type is displayed, or by selecting a Chart type. One or more files may be selected, as shown below. If you select multiple files, they can be combined (averaged), and you’ll be given the option of saving the combined file.
If the folder contains meaningless camera-generated file names such as IMG_3734.jpg, IMG_3735.jpg, etc., you can change them to meaningful names that include focal length, aperture, etc., with the View/Rename Files utility, which takes advantage of EXIF data stored in each file.
The folder saved from the previous run appears in the Look in: box on the top. You are free to change it. The file name from the previous run is displayed at the bottom. You can open a single file by simply double-clicking on it. You can select multiple files for combined runs (for interactive or SFRplus auto runs) or for batch runs (for SFRplus auto-only) by the usual Windows techniques: control-click to add a file; shift-click to select a block of files. Then click . Three image files for the Canon 17-40mm L lens are highlighted. Large files can take several seconds to load.
|Multiple file selection Several files can be selected in Imatest Master using standard Windows techniques (shift-click or control-click). For SFRplus interactive (Rescharts) runs, files can be combined to reduce noise or (in some instances) observe the effects of camera shake or image stabilization. For runs, you can run large batches of images. The multi-image dialog box gives you the option of saving the combined file, which will have the same name as the first selected file with _comb_n appended, where n is the number of files combined.|
|RAW files Imatest can analyze raw files from cameras (using dcraw) or from development systems (using Generalized Read Raw). The files can be demosaiced or Bayer raw: standard files (TIFF, etc.) that contain undemosaiced data. Undemosaiced files are not very useful for measuring MTF because the pixel spacing in each of the four image planes is twice that of the image as a whole; hence MTF is lower than for demosaiced files. But Chromatic aberration can be severely distorted by demosaicing, and is best measured in Bayer RAW files (and corrected during RAW conversion). Details of RAW files can be found here|
SFRplus setup window
When the file (or files) have been opened, the SFRplus setup window, shown below, appears. This window allows you to select groups of regions (ROIs; shown as violet rectangles) for analysis. It also lets you select the size of the regions, whether to analyze vertical or horizontal edges, and much more. Pressingon the left opens the SFRplus More settings, which allows you to select additional settings that affect the calculations and display. Pressing lets you select the output figures and files (for SFRplus auto mode runs). The light yellow-orange rectangles are for calculating the Color/lightness uniformity profiles.
SFRplus setup window; 13 regions selected for analysis
|SFRplus setup window Settings relevant to speedup are shown with red background.
|Gamma||Assumed Gamma (contrast) of the chart. Has a small effect on the MTF results. Default is 0.5. Overwritten if the Use for MTF checkbox (below Chart contrast) is checked. Described in more detail below.
|Channel||Select channel to analyze: R, G, B, Y, R-only, G-only, B-only, Y-only. (Y is Luminance channel). Use one channel only to speed up calculations or where other channels are dark or may not contain valid data. Selecting one channel-only can significantly speed up calculations.
(for gamma calc.)
|Chart contrast– for the contrasty squares (i.e., most of them). Used to estimate gamma from the image.|
|Use for MTF||(Checkbox, normally unchecked) When checked, the gamma derived from the chart is used for the MTF calculation. This may result in a small improvement in accuracy.|
|Open the SFRplus More settings window, shown below.|
|Open the SFRplus Auto mode settings window, shown below, for controlling .|
|ROI Selection & analysis area|
(Selects which regions to locate. Actual ROIs are located
Select the regions (ROIs) to analyze. Choices below. The number of regions is in parentheses. This is a particularly important setting. We encourage users to become familiar with the settings below. Note that the squares above and below the middle square are usually not selected for analysis; they are reserved for other purposes (step chart, color chart, and/or focusing pattern). At least 13 regions are required for 3D plots. These selections are indicated by , below.
1. Center (1)
2. Center & corners (5)
3. Center, corners, part-way (9) (Part-way on diagonal between center & corners)
4. Center, L, R, T, B (5)
5. Center, corners, L, R, T, B (9)
6. Center, corners, part-way, L, R, T, B (13) This is the smallest selection that can be used with 3D displays. This setting is often a good compromise between speed and detail.
7. 5 rows, 5 columns (except step & color ROIs) (23) (edges on a 5×5 grid, omitting the squares above and below the middle). Highly detailed results, well-suited for 3D displays.
8. Inner squares (max 3×5), outer edges A 3×5 grid (omitting squares above and below the middle) representing the central region of the image.
9. All inner squares, outer edges. A tight grid of squares covering most of the image, except near the edges.
10. All squares, inner & boundary edges (best 3D map). A highly detailed grid, recommended for detailed 3D displays. The edges tend to be non-overlapping.
11. All squares, edges (many; overlapping; slow) All available edges; not generally recommended.
12. Center, part-way to corners (for mfg test) (5) This is a minimal pattern for manufacturing testing, where high speed is required.
13. All squares, inner & bdry except low contrast (good 3D map). A highly detailed grid, recommended for detailed 3D displays for charts that have two contrast levels (mostly high and a few low). The edges tend to be non-overlapping.
14. Skype spec: center, above-L, & below-R ctr. See the Skype support page.
An Edge ID/Zone selection file contains a list of identifiers for slanted edge ROI locations or selection zones, one per line, similar to lists in CSV and JSON output files. There are two types of data line: for individual ROIs and for ROI selection zones. It allows you to freely select edges or zones.
Click Read EdgeID file to read the file. Then click OK.
Individual edge ROI selection lines: The format is Column_Row_Side, where
Example: -2_1_L selects the left edge of the square two columns left of center and one row below center.
Zone selection lines (Imatest 5.0+): The format is Z ii nn or S ii nn, where
Example: Z 60 80 selects all edges with centers between 60 and 80% of the way between the image center and the corner. Several zones can be selected.
16. Use most recent EdgeID file.
Other selections may be added on user request.
|Vertical, Horizontal edges (or both)||Chooses between Vertical and Horizontal edges (or both). Usually Vertical, but Horizontal is useful on occasion. Use both for Lens-style MTF plots. For 3D plots it’s best to plot Horizontal or Vertical-only.
|Step chart (checkbox)||Perform step chart analysis. Should be unchecked for charts that do not include the step chart (such as transmissive chrome-on-glass charts). Checked by default.|
|Color chart (checkbox)||Perform color analysis. Should only be checked for charts that include the optional color pattern. Be sure the correct Color reference (file name) and Color space has been entered in the Settings region of the Settings window. Unchecked by default.|
|Rows(Auto or number)||The number of rows of squares in the chart (between the top and bottom bars) or Auto for automatic row detection (the default). In rare cases Automatic row detection may fail and the actual number of rows (4, 5, or 7) may work better. If there are no bars, select Auto- no bars, and the regions will be similar to what you would get with the bars at the top and bottom of the image. (Distortion and Field of View won’t be calculated.)
|Negative||Check this box for negative images (light squares on dark background).|
|Speedup (checkbox)||Speed up the run by eliminating some calculations that many users don’t require, including SQF/Acutance, noise statistics and histograms.|
|ROI size||Slider that determines the size of the ROI. Use the largest value that keeps a save distance from edges of squares and top and bottom bars. May need to be reduced where distortion is severe.|
|Allows borders to be cropped to remove interfering patterns that might otherwise be included in the image. This button is tinted pink whenever the image is cropped.|
(below ROI size slider)
|Width of ROI selection. Normal width for the standard rectangular ROI. Choose Wider or Widest for very fuzzy edges, for enhanced noise analysis, or for more extended low frequency response.|
|Title||Title. Defaults to file name. You can add a description.|
|Open this web page in a web browser.|
|Display … image||Selects image for Setup window display: Original (RGB) image, R, G, or B channel|
|Save settings (for use in auto SFRplus), but do not continue with run.|
|Save settings and continue with run: Calculate results for all selected region. You will be able to view results interactively.|
|Cancel run; do not save settings|
After you’ve finished making settings, clickto save settings and continue with the run. You can Click to save the settings without continuing.
|Setting||Value(s) for fast operation||ini file for IT||Effect|
|Channel||[S] One channel (typically Y (luminance))-only||RGBY_value = 8||Major|
|Speedup||[S] Checked (on). Turns off slow noise & histogram calculations.||speedup = 1||Major|
|Step chart||[S] Unchecked (off, unless needed)||stepchart = 0||Minor|
|Analyze color patches||[S] Analyze square above center recommended (unless color needed)||colorchart = 0||Minor|
|Edge roughness||Unchecked||edgerough = Min||Minor|
|Acutance analysis||Unchecked||SQF = Min||Minor|
|[S] means this setting is in the SFRplus setup window (most are also in More settings). Others are in More settings-only.|
|IT users: See the knowledge base post, Speeding up Imatest IT with INI File Settings . INI file settings (above) are for the [sfrplus] section of the ini file.|
More settings window
The SFRplus More settings window, shown below, opens when
- is pressed in the SFRplus setup or Rescharts windows.
- Settings, SFRplus settings is pressed in the Imatest main window, then is pressed in the SFRplus setup window.
The settings are read from imatest.ini, and saved when SFR input dialog box.is pressed. Settings are similar to the settings in the
|You can select either Expert or Simplified mode for the settings window. In Simplified mode many settings are grayed out so they can’t be set. If you press , commonly used settings (recommended for beginners) are selected.|
This window is divided into sections: Title and on top, then Display options, Settings, Optional parameters, and finally, or at the bottom.
Title defaults to the input file name. You may leave it unchanged, replace it, or add descriptive information for the camera, lens, converter settings, etc.— as you please.
opens a browser window containing a web page describing the module. The browser window sometimes opens behind other windows; you may need to check if it doesn’t pop right up.
|Display options (below Plot) contains settings that affect the display (units, appearance, etc.).
MTF plot units selects the spatial frequency units for MTF plots for for the summary plot. Cycles/pixel (C/P), Cycles/mm (lp/mm), Cycles/inch (lp/in), Line Widths per Picture Height (LW/PH), and Line Pairs per Picture Height (LP/PH) are the choices. (Note that one cycle is the same as one line pair or two line widths.) If you select Cycles per inch or Cycles/mm, you must enter a number for the pixel size— either in pixels per inch, pixels per mm, or microns per pixel. For more detail on pixel size, see the box below.
Maximum MTF plot frequency selects the maximum display frequency for MTF plots. The default is 2x Nyquist (1 cycle/pixel). This works well for high quality digital cameras, not for imaging systems where the edge is spread over several pixels. In such cases, a lower maximum frequency produces a more readable plot. 1x Nyquist (0.5 cycle/pixel), 0.5x Nyquist (0.25 cycle/pixel), and 0.2x Nyquist (0.1 cycle/pixel) are available.
Secondary readout controls the secondary readout display in MTF plots. The primary readout is MTF50 (the half-contrast spatial frequency). Two secondary readouts are available with several options. The first defaults to MTF30 (the spatial frequency where MTF is 30%). The third is used only for SFRplus Lens-style MTF plots.
Clicking Change opens the window shown on the right. Secondary readout settings are saved between runs. Choices:
Edge plot selects the contents of the upper (edge) plot. The edge can be cropped
|Settings affect the results as well as the display.
Edge roughness Calculate edge roughness (for inclusing in CSV output). Slows calculations slightly. Required if Edge roughness plot is to be displayed.
MTF noise reduction (mod apod) Reduce noise using the modified apodization technique. Improves MTF accuracy, especially with noisy images, but not an ISO standard calculation. Generally recommended.
Channel specifies the primary channel to display (all channels are analyzed). It’s normally left at it’s default value of Y for the luminance channel,
Color reference and Color space are used when a color analysis is to be performed (if the image contains the color pattern and the Color chart box is checked in the SFRplus setup window). The Color reference dropdown menu allows you to browse for the
Gamma (the average slope of log pixel levels as a function of log exposure for light through dark gray tones) is used to linearize the input data, i.e., to remove the gamma encoding applied by the camera or RAW converter. It defaults to 0.5 = 1/2, which is typical of digital cameras, but may be affected by camera or RAW converter settings. Small errors in gamma have little effect on MTF measurements (a 10% error in gamma results in a 2.5% error in MTF50 for a normal contrast target). Gamma should be set to 0.45 or 0.5 when dcraw is used to convert RAW images into sRGB or a gamma=2.2 (Adobe RGB) color space. It is typically around 1 for raw images that haven’t had a gamma curve applied. If gamma is set to less than 0.3 or greater than 0.8, the background will be changed to pink to indicate an unusual (possibly erroneous) selection.
If the chart contrast is known and is ≤10:1 (medium or low contrast), you can enter the contrast in the Chart contrast (for gamma calc.) box, then check the Use for MTF checkbox. Gamma will be calculated from the chart and displayed in the Edge/MTF plot.
If chart contrast is not known you should measure gamma from an image of a grayscale stepchart. A grayscale is included in SFRplus charts. Gamma is calculated when SFRplus is run and displayed in the Tonal Response/Gamma/White Bal plot. Gamma can also be calculated from any grayscale stepchart (a huge variety is available) by running Colorcheck, Stepchart , Multicharts (interactive), or Multitest. A nominal value of gamma should be entered, even if the value of gamma derived from the chart (described above) is used to calculate MTF.
|Gamma is the exponent of the equation that relates image file pixel level to luminance. For a monitor or print,
Output luminance = (pixel level)gamma_display
When the raw output of the image sensor, which is linear, is converted to image file pixels for a standard color space, the approximate inverse of the above operation is applied.
pixel level = (RAW pixel level)gamma_camera ~= exposuregamma_camera
The total system gamma is gamma_display * gamma_camera. Standard values of display gamma are 1.8 for older color spaces used in the Macintosh and 2.2 for color spaces used in Windows, such as sRGB (the default) and Adobe RGB (1998).
In practice, gamma is equivalent to contrast. More on gamma can be found in SFR Instructions, part 2.
Incident lux (for ISO sensitivity calculations) When a positive value of incident light level (not blank or zero) in lux is entered in this box, ISO sensitivity is calculated and displayed in the Stepchart noise detail figure. More details are on the ISO Sensitivity and Exposure Index page.
Zone weights Weights of the center, part-way, and corner zones. Used for calculating weighted means of key results, displayed in the Multi-ROI and 3D plots. The defaults of 1 (center), 0.75 (part-way), and 0.5 (corners) are for typical pictorial photography; corners should probably be given more weight for technical photography.
Wavelength (um) for diffraction-limited MTF plot. If a number is entered (0.555 um is the default for visible light systems) and pixel spacing is also entered, the diffraction-limited MTF is displayed on the MTF plot and the diffraction-limited edge or Line Spread Function (cross-section of Airy disk) is shown on the edge plot as a faint dashed line.
Bar-to-bar chart height in cm is used to calculate the Field of View (FoV) when Pixel spacing (pitch) has been entered. It is optional (not normally entered). The bar-to-bar chart height is measured from the top of the top bar to the bottom of the bottom bar. For pre-distorted charts, use the center distance, as shown on the right. FoV is displayed in Image & Geometry and reported in the CSV output file if calculated.
Lens-to-chart distance in cm is used to calculate the actual lens focal length when Pixel spacing (pitch) and bar-to-bar chart height have been entered. It is optional. The distance from the lens to target is most conveniently measured with a laser measuring device. Focal length is displayed in Image & Geometry and reported in the CSV output file if calculated.
Standardized sharpening If the checkbox is checked, standardized sharpening results are displayed as thick red curves and readouts in the edge and MTF plots. If it is unchecked, standardized sharpening are omitted, which reduces the visual clutter. Results for individual R, G, and B channels are displayed with more prominence (in Imatest Master), and edge noise is displayed. The MTF .CSV summary file is unaffected. See SFR instructions for more details.
restores the settings in SFRplus More Settings to their default values.
|Additional parameters (all optional) for Excel .CSV output contains a detailed description of the camera, lens, and test conditions. EXIF data is entered, if available, but can be overridden by manual settings. Description & settings is particularly useful for annotating the test system (it is displayed in MTF Compare).These settings are optional but can be useful when several tests are run for different lenses, focal lengths, apertures, or other settings. The settings are displayed next to the MTF plots. They are saved and reused in subsequent runs for files with the same pixel dimensions. If EXIF data is available (currently, only in JPEG files) it overrides the saved settings. The Reset button clears all entries.|
ISO standard SFR If this checkbox is checked, SFR calculations are performed according to the ISO 12233 standard, and the y-axis is labeled SFR (MTF) (ISO standard). This method is slightly less accurate than the normal Imatest calculation, which incorporates a number of refinements, including a better edge detection algorithm and a second-order polynomial fit to the average edge for a more accurate estimate of SFR in the presence of lens distortion. This box is normally left unchecked; it should only be used for comparing normal Imatest calculations to the ISO standard. The difference is typically very small.
When entries are complete, click Calculating… boxes appear to let you know how calculations are proceeding. When calculations are complete, results are displayed interactively in the Rescharts window, as shown below.to return control to the SFRplus setup window or to save settings and return to the Imatest main window. When all entries are complete, click either , , or . saves the settings for use in automated SFRplus runs, which can be initiated from the button in the main Imatest window. saves the settings then calculates results for interactive viewing. A sequence of
Auto mode settings window
Auto mode settings affect plots and output files for SFRplus Auto runs as well as Imatest IT/EXE and DLL. It does not directly affect interactive (Rescharts) runs. The SFRplus Auto mode settings window, shown below, opens when
- Auto mode settings is pressed in the SFRplus setup window.
- More settings is pressed in the Rescharts window, then Switch to SFRplus Auto mode setup is pressed in the More settings window.
- Settings, SFRplus Auto settings is pressed in the Imatest main window.
The upper box allows you to select single and multi region figures to be plotted and saved in SFRplus auto output. For the most part they are self-explanatory. Note that all plotted figures are saved.
Saved figures, CSV, XML, and JSON files are given names that consist of a root file name (which defaults to the image file name) with a suffix added. Examples:
When 3D plot is checked, SFRplus auto plots the last 3D plot displayed in Rescharts unless the button has been pressed and one or more plots has been selected. More 3D plots will be displayed in pink in this case. This allows several 3D plots to be displayed and saved by SFRplus auto.
Close figures after save should be checked if a large number of figures are to be displayed. It prevents a buildup of figures, which can slow processing.
Figures can be saved as PNG or FIG files. PNG files (a losslessly-compressed image file format) are the default— they require the least storage. Matlab FIG files allow the data to be manipulated– Figures can be resized, zoomed, or rotated (3D figures-only), but FIG files should rarely be used because they can be huge. PNG files are preferred if no additional manipulation is required.
A CSV summary file is saved for all runs. An XML file is saved if Save XML results is checked.
You can select either Save CSV files for individual ROIs or Save summary CSV file only (the summary file is always saved).
Save folder determines where results are stored. It can be set either to subfolder Results of the image folder or to a folder of your choice. Subfolder Results is recommended because it is easy to find if the image folder is known.
|A Clipping warning is issued if more than 0.5% of the pixels are clipped (saturated), i.e., if dark pixels reach level 0 or light pixels reach the maximum level (255 for bit depth = 8). This warning is emphasized if over 5% of the pixels are clipped. Clipping reduces the accuracy of SFR results. It makes measured sharpness better than reality.||
|The percentage of clipped pixels is not a reliable index of the severity of clipping or of MTF measurement error. For example, it is possible to just barely clip a large portion of the image with little loss of accuracy. The plot on the right illustrates strong clipping, indicated by the sharp corner near the “shoulder” on the black line. The MTF measurement is better than reality. The absence of a sharp corner indicates that there is little MTF error.Clipping can usually be avoided with a correct exposure— neither too dark nor light— and by avoiding high contrast targets (like the old ISO-12233 chart). The maximum recommended edge contrast is 10:1; 4:1 contrast (recommended in the upcoming revision to the ISO-12233 standard) is even better. Low-contrast targets are more reliable overall: in addition to better exposure latitude (reduced risk of clipping), they tend to have less sharpening in cameras with variable signal processing, and MTF results are less sensitive to errors in estimating gamma.||
- SFRplus analyzes images of the SFRplus test chart, framed so that there is white space above and below the horizontal bars in the chart, i.e., so neither bar runs off the top or bottom of the image. The bars may, however, run off the sides of the image. The white space should be between 0.5% and 25% of the image height. There should be few or no interfering patterns (bars, etc.) outside the image of the chart itself. Imatest 3.9+ can analyze images without bars.
- Lighting should be even and glare-free. Lighting and alignment recommendations are given in The Imatest test lab.
- The first time SFRplus is run, it should be run through Rescharts. This allows
- parameters to be adjusted and saved for later use in the automatic version of SFRplus, which is opened with the button in the Imatest main window.
- results (listed above) to be examined interactively in the Rescharts window.
- The Imatest window runs SFRplus in full automatic mode using settings saved from the most recent Rescharts run. button on the main
Pixel size is closely related to image quality. For very small pixels, noise, dynamic range and low light performance suffer. Pixel size is rarely given in camera spec sheets: it usually takes some math to find it. If the sensor type and the number of horizontal and vertical pixels (H and V) are available, you can find pixel size from the table on the right and the following equations.
pixel size in mm = (diagonal in mm) / sqrt( H2 + V2 )
Pixel size in microns (microns per pixel) can be entered directly into the SFR settings box. Example, the cute little 5 megapixel Panasonic Lumix DMC-TZ1 has a 1/2.5 inch sensor and a maximum resolution of 2560x1980 pixels. Guessing that the diagonal is 7 mm, pixel size is 2.1875 (rounded, 2.2) microns.You can find detailed sensor specifications in pages from Sony, Panasonic, and Kodak.