FIXME **This page is not fully translated, yet. Please help completing the translation.**\\ // (remove this paragraph once the translation is finished) // ==== IEEE 2020-2024 CPI Test ==== **Definition of CPI**\\ Contrast is a crucial fundamental condition for distinguishing objects from their surroundings. **Contrast Performance Indicators (CPI)** are test metrics used to evaluate the contrast reproduction capability of imaging systems. There are two main types: **Contrast Transfer Accuracy (CTA/CDP)** and **Contrast Signal-to-Noise Ratio (CSNR)**.\\ **Contrast Transfer Accuracy (CTA)**: Equivalent to the term Contrast Detection Probability (CDP), it is used to calculate the pixel-by-pixel probability that scene contrast is accurately reproduced within a specified tolerance under given imaging conditions.\\ **Contrast Signal-to-Noise Ratio (CSNR)**: Used to estimate the quality of signal separation under given imaging conditions by comparing the mean contrast with its standard deviation.\\ Traditional methods (SNR + global tone curve) have limitations in evaluating the contrast recording capability of cameras in automotive scenarios: in strong glare scenes, the noise distribution is non-monotonic, and SNR cannot reflect the true loss of contrast; in high dynamic range (HDR) scenes, SNR only describes the signal-to-noise ratio and cannot quantify the contrast reproduction capability across different luminance intervals. Therefore, to address the challenges of complex lighting conditions faced by automotive cameras, Contrast Performance Indicators (CPI) must be introduced to accurately evaluate the true contrast reproduction capability of imaging devices for scene contrast.\\ | {{ :yanding:成像质量评价:标准化测试:cdp降低.png? |}} | | Examples of reduced input contrast | As shown in the left figure, dense fog causes a reduction in the local contrast of traffic signs. In the right figure, stray light on the windshield reduces the detectability of vehicles. **Principles of KPI Calculation**\\ **Contrast Transfer Accuracy (CTA, equivalent to CDP)**\\ **CTA (CDP)** is a metric describing the ability of an imaging system's output contrast to truly reproduce the input luminance contrast (in specific regions of the scene). It is used to calculate the pixel-by-pixel probability that scene contrast is accurately reproduced within a specified tolerance under given imaging conditions.\\ The calculation process is as follows:\\ **(1) Data Linearization and Input Contrast Calculation**\\ First, the digital numbers (DN) of the image are converted into linear input units (luminance or radiance) using the inverse of the opto-electronic conversion function (OECF) to establish the camera response curve, eliminating the impact of system nonlinearity on subsequent calculations.\\ | {{ :yanding:成像质量评价:标准化测试:cpi2.png?400 |}} | ^ Camera response curve (mapping image grayscale value domain back to physical luminance domain) ^ After linearization, for the selected patches (the bright patch with the highest input luminance (or radiance) and the dark patch with the lowest input luminance (or radiance)), the mean input luminance $(L_{in})$ is calculated:\\ $(L_{in})=(L_{max}+L_{min})/2$\\ where: $L_{in}$ is the mean input luminance; $L_{max}$ is the luminance of the brightest patch; $L_{min}$ is the luminance of the darkest patch.\\ For the test patches (bright patch $L_{max}$, dark patch $L_{min}$), the input contrast is calculated based on the known luminance values using the Weber contrast or Michelson contrast formulas, denoted as $C_{W}$ or $C_{M}$, respectively:\\ Using the Weber contrast formula:\\ $C_{W}=\frac{L_{max}}{L_{min}}-1$\\ where: $C_{W}$ defines the Weber contrast; $L_{max}$ is the luminance of the brightest patch; $L_{min}$ is the luminance of the darkest patch.\\ $C_{W}$ is an unbounded function, and the case where $L_{min}$ approaches 0 is common in low-light scenarios. Using the Michelson contrast formula:\\ $C_{M}=\frac{L_{max}-L_{min}}{L_{max}+L_{min}}$ The Michelson contrast ranges from 0 to 1, and its value approaches 1 as Lmin approaches 0.\\ **(2) Probability Density Function**\\ The calculation of contrast metrics is performed by constructing the probability distribution of the measured contrast for a given pair of patches from the linearized data. At least 10,000 pixel combinations must be evaluated for individual pixels between $L_{max}$ and $L_{min}$ to calculate the measured contrast $C_{M}$, yielding the normalized probability density function of the measured contrast $C_{\text{PDF}}$. If there are n patches, $\frac{n(n-1)}{2}$ measured contrast distributions will be generated. {{ :yanding:成像质量评价:标准化测试:cdp.png? |}} **(3) Calculating Contrast Transfer Accuracy (CTA)**\\ It is defined as the probability P that the measured contrast ${C_{mean}}$ falls within a specified interval determined by the selected contrast bounds ${\delta}$ and the input contrast $C_{in}$. The formula is:\\ $CTA_{C_{\text{in}}} = P\left[(C_{\text{in}} - \delta_- \times C_{\text{in}}) \leq C_{\text{meas}} \leq (C_{\text{in}} + \delta_+ \times C_{\text{in}})\right]$\\ where:\\ $C_{\text{meas}} $: the actual measured contrast of the patch pair extracted from the linearized image;\\ $\delta_- , \delta_+ $: the lower and upper bound increments of the error interval, respectively (both default to 10%, meaning the deviation between the measured contrast and the input contrast is allowed to be within \( \pm 10\% \));\\ $ P $: the proportion (probability) of pixels (or samples) that satisfy the above interval conditions.\\ The recommended default contrast is defined as the Michelson contrast. | {{ :yanding:成像质量评价:标准化测试:cdp计算.png?400 |}} | ^ Display of CDP (CTA) assuming a 50% confidence interval ^ **Contrast Signal-to-Noise Ratio (CSNR)**\\ **CSNR** is a metric describing the ratio of contrast to contrast noise. It can be calculated based on **Michelson Contrast** or **Weber Contrast** and is used to evaluate the separation quality of the contrast signal under given imaging conditions.\\ Taking Michelson contrast as an example, the calculation formula is as follows:\\ $CSNR = \frac{\bar{C}}{\sigma_{C_{\text{PDF}}}}$\\ where: $\bar{C}$ is the mean contrast of the test patches; $\sigma_{C_{\text{PDF}}}$ is the standard deviation of the contrast. **Considerations for KPI Application:**\\ (1) CTA and CSNR are complementary metrics; a single metric cannot comprehensively characterize the system's contrast performance.\\ When the contrast distribution falls within the specified bounds, the maximum value of CTA is 1; as the contrast distribution narrows further, CTA remains at 1. Conversely, as the contrast distribution narrows, CSNR will continue to rise, at which point the values of CSNR and CTA will begin to diverge.\\ (2) At low light levels, the noise distribution may not be Gaussian, so the mean and standard deviation of the contrast distribution used for CSNR may not fully describe the noise process. Therefore, CTA and CSNR must be calculated separately in different luminance intervals (e.g., dark, mid-tone, and bright regions) to evaluate the system's contrast reproduction capability across the full dynamic range.\\ (3) CTA is input-referenced, so linearization is mandatory when calculating CTA; CSNR can be calculated without linearization, which can be used to test the performance of the Image Signal Processor (ISP) in scenarios where non-linear processes exist and the tone curve cannot be inverted.\\ (4) Boundary conditions of the metrics must be noted: if any luminance patch is saturated, both CSNR and CTA should be considered undefined. If the difference between the output contrast and the input contrast is very large (too low or too high), CTA will be zero, while CSNR will not be zero. Local tone mapping may introduce local gradients on the patches or in the transition areas between patches, potentially leading to misleading results.\\ **Test Requirements**\\ **Lighting Requirements:**\\ (1) Environmental control: Data acquisition must be performed in a controlled lighting environment to ensure no unexpected light sources illuminate the Device Under Test (DUT) or the test target; stray light must be eliminated, using baffles if necessary; a darkroom is recommended, and stray light or reflections on the patches should be checked before measurement. (2) Light source uniformity: The luminance produced by the test light source should be as uniform as possible, and both the average luminance and uniformity must be recorded. (3) Stray light elimination: Priority should be given to eliminating stray light generated by light sources outside the field of view of the DUT. **Camera Settings:**\\ **Exposure and Gain Control:** When multi-frame data acquisition is required (e.g., temporal domain recording), the camera should be controlled to ensure no significant changes in exposure, gain, and other functions affecting image output. When using temporal domain recording, all automatic functions of the camera should be turned off.\\ **Focus Control:** When using spatial domain recording, the DUT should be focused on the test target. If significant defocus occurs due to temperature or focus drift, refocusing is allowed, and the focus change should be recorded. Good focus helps ensure that the Region of Interest (ROI) in the image can be associated with the input patches, and the ROI edges will not be distorted by image blur. A larger ROI size can tolerate more defocus.\\ **Test Targets:**\\ Data recording is divided into two methods: **spatial domain recording** and **temporal domain recording**.\\ **Temporal domain**: Allows a single luminance to be presented to the DUT per exposure, which can exclude the influence of glare.\\ **Spatial domain**: Achieves single-exposure acquisition by spatially arranging multiple patches, resulting in higher test efficiency.\\ **Hybrid method**: Combining spatial and temporal domains can reduce the number of exposures or increase the amount of data available for computation.\\ **Luminance**: Specific luminance levels are selected based on the application. The number and range of luminance steps define the test coverage; fewer steps are used for quick evaluation of critical intensity/contrast ranges, while more steps are used for detailed evaluation over a wider range.\\ **ROI Requirements**: Must be large enough to generate useful statistical information; it is recommended that each ROI exceeds 10×10 pixels per color channel in the final image. **Yanding Equipment Support:**\\ [[https://yanding.com/product/detail?id=1830|MLB-HMC ADAS Camera Comprehensive Tester]] {{ :yanding:成像质量评价:标准化测试:hsb_.png?600 |}} The MLB-HMC ADAS Camera Comprehensive Tester is a solution specifically designed for image quality evaluation of Advanced Driver Assistance Systems (ADAS). It utilizes 4 rear transmissive light boxes paired with 4 grayscale charts of different densities. By setting relevant parameters for the light source, it generates different luminance patch distributions under high dynamic range to measure the CPI of the imaging system.\\ [[https://yanding.com/product/detail?id=1941|RT-CFT ADAS Camera Comprehensive Tester]] | {{ :yanding:成像质量评价:标准化测试:cft_.png?400 |}} | {{ :yanding:成像质量评价:标准化测试:cft.png?500 |}} | The RT-CFT can be used for CPI and Flicker testing and analysis of ADAS camera systems. It contains 150 grayscale patches and supports a dynamic range of up to 140 dB; the grayscale chart can automatically adjust its angle to compensate for wide-angle camera distortion; the RIQA analysis software supports parameter curves such as CDP, FMI, FDI, and MMP. **[[https://yanding.com/product/detail?id=1932|RIQA-ADAS Image Quality Analysis - ADAS Module]]**\\ [[https://yanding.com/product/detail?id=1932|{{ :yanding:成像质量评价:标准化测试:r2.png?400 |}}]] RIQA-ADAS is a professional image quality analysis software specifically developed for autonomous driving and automotive cameras. The algorithm of its CPI module is based on the IEEE 2020-2024 standard, enabling the quantification of the contrast reproduction capability of camera modules.\\