Local Magnification

Introduction

Local magnification is an intuitive metric that can be used to evaluate geometric distortion in images. It maps object magnification (in both radial and tangential directions) with image field height.

Imatest version 26.1 added calculation of local magnification and associated metrics based on the method of Wang et al. [1].

Imatest extends the methods presented in the paper by offering configurable settings, automated processing, and expanded outputs, allowing the method to be applied effectively for a range of camera types and test objectives. As described in the paper, additional metrics can be derived from local magnification data including radial/optical distortion percentage, TV distortion metrics, field of view, and classification of the lens projection method / mapping function. Imatest can perform these additional calculations as part of the analysis. 

Calculation of local magnification is currently available for Checkerboard analysis and must be explicitly enabled in the settings for the target.

Key Assumptions

Below are some of the key assumptions behind the measurements.

Example Outputs

Available outputs and visualizations for local magnification include:

Note: Plot axes units are configurable. Axes for local magnification can be expressed in either absolute terms (image scale factor) or center-normalized. Axes for image radius can be expressed in units of either pixels, millimeters (on image sensor), or normalized (to max image radius). Axes for object radius can be expressed in units of either grid steps, millimeters (on object), or normalized (to max image radius on the object). 

Results and data are also included in Imatest’s standard CSV and JSON output files.

Calculations

Note: Local magnification calculations are separate from other pre-existing geometric distortion calculations in Imatest. Imatest checkerboard analysis produces radial distortion models that are separate from those related to local magnification and are also dependent on separate settings, calculations, etc.

Please see the reference paper for details on the calculations used to measure local magnification and associated metrics. Imatest follows the methods described in the paper with few deviations.

Extensions and deviations from the methods described in paper are noted below.

Extensions

Deviations

Instructions

Instructions for measuring local magnification are below.

Setup & Capture

  1. Measure the target’s grid pitch, e.g., the height of a checker.
  2. Align the camera with the target.
    1. The target grid plane should be perpendicular to the optical axis of the camera with one grid point (e.g., a checkerboard saddle point) aligned with the numeric image center.
    2. The center row and column of the target grid should be parallel to the edges of the image frame.
    3. The target grid should fill the image frame.
    4. The target grid should have at least one detectable grid point (e.g., a checkerboard saddle point) close to the sides of the image or the desired maximum radius.
  3. (Optional – for field of view and projection classification) Measure the distance between the camera entrance pupil and the center of the target.
    1. Note: The camera entrance pupil position is usually somewhere within the camera lens.
  4. Capture an image of the target.
    1. The image of the target should be in-focus (sharp) and well-exposed.
    2. The overall quality of the image should be sufficient such that reflections, noise, or other image artifacts do not reduce the accuracy of grid point (e.g., checkerboard saddle point) detection/localization.
    3. (Optional) Multiple images can be captured and then averaged using Imatest to potentially reduce the various effects of noise.

The following example image is from an Olympus EXERA II, which is the same camera device that was tested in the reference paper. According to the paper, the pixel pitch of the image sensor is 2.8 microns. The checker height is assumed to be 4 millimeters and the target distance is assumed to be about 25 millimeters. The camera and target are reasonably well aligned, though not perfectly, as the centermost grid point is slightly offset from the numeric image center.

An example image of a checkerboard that can be used to measure local magnification.

Imatest Analysis

  1. In the main window, navigate to Settings > Distortion (or Sharpness) > Checkerboard > Local Magnification.
  2. Enable Compute Local Magnification to have Imatest compute local magnification and associated metrics.
  3. Enter the image sensor Pixel Pitch in microns.
  4. Enter the target’s Grid Pitch, e.g., the height of a checker, in millimeters.
  5. (Optionally) Enable Compute Projection Classification to have Imatest compute field of view and classify the lens projection method / mapping function from the local magnification data.
    1. Enter the Target Distance (the distance between the camera entrance pupil and the target center) in millimeters.
  6. (Optionally) Enable Compute TV Distortion to have Imatest compute TV distortion metrics from the local magnification data. TV distortion results are included in the JSON/CSV outputs. 
  7. (Optionally) Configure remaining calculation settings.
    1. (Optionally) Configure the Radial Directions to choose which points from the detected grid are used for calculations. Samples from the chosen directions are averaged by common grid-step distance before computing the polynomial fits.
    2. (Optionally) Configure the Origin to choose the origin for distortion measurements. 
    3. (Optionally) Configure the Max Radius to choose the image boundary that defines the maximum radius for distortion measurements and normalization.
    4. (Optionally) Configure the Polynomial Fit Degree to choose the degree of the polynomial fits that map image radius and object radius, or to use as the maximum degree for Auto-Select Degree searches.
    5. (Optionally) Enable Auto-Select Degree: Boundary Fit to automatically select the degree for the initial polynomial fit (based on the Minimum R² criteria) used to estimate object radius at the chosen max image radius (Max Radius).
    6. (Optionally) Enable Auto-Select Degree: Normalized Fits to automatically select the degree for the polynomial fit (based on the Minimum R² criteria) used to compute local magnification, as well as the associated inverse fit.
    7. (Optionally) Configure the Minimum R² to specify the lowest acceptable coefficient of determination (R²) a fit must meet for it to be selected during Auto-Select Degree searches.
    8. (Optionally) Enable Use Adjusted R² to have Auto-Select Degree searches evaluated using adjusted R² instead of standard R².
  8. (Optionally) Configure the Local Magnification Auto (Batch) Plots settings used for auto/batch analysis. These settings do not affect plots in interactive analysis.
    1. Select which units to use for various plot axes. Selecting multiple units will produce multiple versions of the relevant plots. 
    2. Select the output file format for the plots.
    3. Select which plots to save and/or display.
  9. Load and select the image(s) to use for analysis.
  10. Select the appropriate target for analysis (i.e., Checkerboard).
  11. (Optionally) Configure any target-specific settings such as detection settings, crop, general outputs, etc. by clicking the gear icon on the selected target to open the Setup window.
    1. (Optionally) Configure Checkerboard Auto (batch) settings by clicking Auto Mode settings on the left side of the Setup window. These settings do not affect interactive analysis.
      1. (Optionally) Enable/disable CSV and JSON outputs (both enabled by default).
      2. (Optionally) Change the Folder for saving results (the default behavior creates a subfolder named “Results” in the directory containing the image(s) under test).
  12. Run analysis.
    1. Interactive:
      1. From the Setup window, verify that the point detection and coverage is sufficiently good.
        1. (Optionally) Select the NO regions: fast geometry calculation option under ROI selection & analysis to disable non-geometry calculations, such as SFR.
        2. (Optionally) Select Crop borders to choose an image crop which, for local magnification calculations, will only affect checkerboard point detection.
        3. (Optionally) Select Target Detection Settings to configure checkerboard detection settings. Checkerboard detection settings can also be configured from the main window by navigating to Settings > Distortion (or Sharpness) > Checkerboard.
      2. Click OK to continue with analysis.
      3. Wait for analysis to complete.
    2. Auto (batch):
      1. Wait for analysis to complete.
  13. View results.
    1. Interactive:
      1. From the Rescharts window, navigate to Display option 18. Local Magnification to see various plots related to local magnification.
      2. Plot axes units are configurable via dropdowns.
      3. Results/data can be saved to standard output files (JSON and CSV) by clicking Save data in the lower-right corner.
      4. A screenshot of the current display can be saved by clicking Save screen in the lower-right corner.
    2. Auto (batch):
      1. Navigate to the output Results folder to find various plot outputs and standard output files (JSON and CSV).
      2. The outputs will reflect the chosen settings under Local Magnification Auto (Batch) Plots, as well as those related to the specific target analysis.

Tips

Results

See the separate Local Magnification Results page for documentation of the JSON/CSV outputs.

References

  1. Q. Wang, W.-C. Cheng, N. Suresh, and H. Hua, “Development of the local magnification method for quantitative evaluation of endoscope geometric distortion,” J. Biomed. Opt., vol. 21, no. 5, p. 056003, 2016, doi: 10.1117/1.JBO.21.5.056003. ↩