Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Introduction

...

Eazy math inline
body\text{pixel level = (RAW pixel level)}^ \ \ \ \ \ \gamma \approx \text{exposure} ^ \gamma

There are actually two gammas:

  1. encoding gamma, which relates scene luminance to image file pixel levels, and

  2. display gamma, which relates image file pixel levels to display luminance. It is typically found in equations of the form,

...

Note that errors in estimating gamma (differences from 0.322) have very little effect on MTF measurements. MTF50 and MTF Area change very slightly, even with relatively large gamma errors. This is a good place discuss Imatest’s ISO 12233 compliance. Imatest uses a simple first-order inverse of the OECF curve (tonal response) measurement to linearize the image. It does not use a higher-order inverse. But because MTF is relatively insensitive to gamma (the slope of the tonal response curve), the simple fit results in nearly identical MTF measurements (except the the exposure is close to saturation, which where it’s hard to avoid dodgy results). 

Which patches are used to calculate gamma in Imatest?

This is an important question because gamma is not a “hard” measurement. Unless the Tonal Response Curve says pretty close to a straight line log pixel level vs. log exposure curve, its measured value depends on which measurement patches are chosen. Also, there have been infrequent minor adjustments to the patches used for Imatest gamma calculations— enough so customers occasionally ask about tiny discrepancies they find.

Light and dark patches where the tonal response curve flattens out are generally omitted from gamma calculations.

For the 24-patch Colorchecker, patches 2-5 in the bottom row are used (patches 20-23 in the chart as a whole).

For all other charts analyzed by Color/Tone or Stepchart, the luminance Yi for each patch i (typically 0.2125×R + 0.7154×G + 0.0721×B) is found, and the minimum value Ymin, maximum value Ymax, and range Yrange = YmaxYmin is calculated. Gamma is calculated from patches the slope of the straight line fit (linear regression) to patches Yi , where Ymin + 0.2×Yrange  < Yi  < Ymax – 0.1×Yrange . This ensures that light through dark gray patches are included and that saturated patches are excluded.

...

The chart on the right is designed for a visual measurement of display gamma. But it  rarely displays correctly in web browsers (and may never display correctly on this Atlassian page, where there is no way to set it to 100% size). It has to be displayed in the monitor’s native resolution, 1 monitor pixel to 1 image pixel. Unfortunately, operating system scaling settings and browser magnifications can make it difficult.

...

  1. Input gamma value(legacy, default) – The inverse of the value entered into the “Gamma (input)” field is used to linearize the data.

    1. Note: The input gamma value represents the “forward” (encoding) gamma value (typically around 0.46 = 1/2.2 for sRGB or Adobe RGB color spaces); the inverse (display gamma) is used for linearization.

  2. Gamma calculated from chart contrast (legacy) – The value selected for the “Chart contrast” setting is used, in combination with the contrast measured from the edge ROI region, to calculate a value for gamma on a per edge ROI basis. The inverse of this gamma is used to linearize the data.

    1. The gamma value is estimated from the ratio of the light and dark pixel levels P1 and P2 in the slanted-edge region (away from the edge) if the chart contrast ratio (light/dark reflectivity) has been entered (and is 10:1 or less). Starting with

      Eazy math inline
      bodyP_1/P_2 = \text{(chart contrast ratio)}^{gamma\_encoding}
      ,
      Eazy math inline
      body\displaystyle gamma\_encoding = \frac{\log(P_1/P_2)}{\log(\text{chart contrast ratio)}}

    2. Note: The calculated gamma value(s) are included in the JSON output as the field “gamma_from_chart”, on a per edge ROI basis (this is not a new output)

  3. No linearization (new) – The data is not linearized.

    1. Note: “Input gamma value” of 1 is equivalent to “No linearization”.

  4. Linearly interpolated LUT from step chart (new, requires step chart analysis to be checked) – A linearly interpolated look-up-table (LUT), representing the inverse of the measured OECF, is calculated from the mean of the grayscale patch (step chart) ROIs and the nominal patch densities (or those from a grayscale reference file). The LUT is used to linearize the data.

    1. Note: A grayscale reference file contains measured patch densities and can be loaded from the Rescharts more settings window

  5. Gamma calculated from step chart (new, requires step chart analysis to be checked) – The mean of the grayscale patch (step chart) ROIs and the nominal patch densities (or those from a grayscale reference file) are used to calculate a value for gamma. The calculated gamma is the slope of a linear fit of the patch densities and log(grayscale patch means). The inverse of this gamma is used to linearize the data.

    1. Note: A grayscale reference file contains measured patch densities and can be loaded from the Rescharts more settings window

    2. Note: The calculated gamma value is the same as that which appears on the Rescharts Tonal Response plot, also corresponding to the gray dotted line on the plot (the gamma value is the slope of this line). Note that there is also a gray dashed line that represents a 2nd order polynomial fit.

    3. Note: The calculated gamma value is included in the JSON output as the field “gamma_from_stepchart” (this is not a new output)

    4. Note: The range of patches is limited for the calculation of gamma, specifically using the patches that have a mean within the central 80% of the total range of patch means. Therefore, some darker or lighter patches may not be used for calculation of this gamma.

...

(warning) Note: The new dropdown replaces the “Use for MTF” checkbox on all relevant GUIs, which now corresponds with the “Gamma calculated from chart contrast” option in the dropdown.

...

INI settings

A new INI field has been added for control of the new “Linearization method” setting on a per INI section (module/analysis) basis:

...

The user-selected linearization method is now included as a new field in the CSV and JSON outputs, as a way of documenting the input method. The new CSV field is “Linearization method”. The new JSON field is “linearization_method”.

...