Validation against ground truth data is an important step when implementing support for physical lighting quantities in a realtime or offline renderer.

In this post, a simple but effective method to assess that the physical camera model behaves as expected against ground truth data (or conversely) will be presented.

Panoramic HDRI Calibration With a plausible DSC Exposure Model implemented, calibrated ground truth data can be imaged for verification purposes. An Artist-Friendly Workflow for Panoramic HDRI by Lagarde, Lachambre and Jover (2016) describes a simple but effective process to calibrate a panoramic HDRI for absolute luminance. The only requirement is to measuring the scene illuminance with a light meter during the HDRI capture. The major advantage of this approach is that it is independent of the imaging device and thus does not require knowledge of its calibration constant \(K\). The multiplying factor \(S_L\) used to convert the panoramic HDRI relative luminance values to absolute luminance values is obtained as follows: \(S_L=\cfrac{E_{vm}}{E_{vi}}\) where \(E_{vm}\) is the metered scene upper hemisphere illuminance in lux (\(lx\)) and \(E_{vi}\) is the upper hemisphere illuminance of the panoramic HDRI in lux, i.e. the upper hemisphere integral of the relative luminance values: \(\int_{\Omega}{L\ cos(\theta)\omega}\) For an equirectangular image, the solid angle \(\omega\) of a pixel is given as follows: \(\omega=sin(\theta)\cfrac{2\pi}{w}\cfrac{\pi}{h}\) where \(w\) and \(h\) are the width and height of the image, respectively. Colour - HDRI implements support for absolute luminance calibration with Python: >>> import colour_hdri >>> import numpy as np >>> RGB = np . ones ([ 2048 , 1024 , 3 ]) >>> colour_hdri . upper_hemisphere_illuminance_Lagarde2016 ( RGB ) >>> colour_hdri . absolute_luminance_calibration_Lagarde2016 ( RGB , 120000 )[ 0 , 0 ] array ([ 38215.85392444 , 38215.85392444 , 38215.85392444 ]) >>> colour_hdri . calibration . absolute_luminance . upper_hemisphere_illuminance_Lagarde2016 ( RGB ) 3.1400580564615663 Note

Careful readers will have noticed that the last call to the colour_hdri.calibration.absolute_luminance.upper_hemisphere_illuminance_Lagarde2016 definition does not return \(\pi\) . This is induced by the numerical discretization to raster space, however, as image dimensions increase toward infinity, the computed value converges toward \(\pi\) , e.g. 3.1414009 and 3.1414968 for 16384x8192 and 32768x16384 sized images respectively. Likewise, Colour - Nuke offers a Gizmo/Group implementation also available on Nukepedia.

Imaging the Panoramic HDRI with the Digital Still Camera Exposure Model A free panoramic HDRI processed accurately is a rarity online. Most vendors sell either non-linear or clipped imagery, and when it is not clipped, photometric and colorimetric information is missing and because the creation process is unknown, the data cannot be trusted for scientific applications requiring physical lighting quantities. Fortunately, Lagarde, Lachambre and Jover (2016) have published a trustworthy panoramic HDRI that will be used in this section. The authors have been kindly enough to send me the original .CR2 files so that I could merge and stitch them. Merging was performed with Colour - HDRI, specifically, by using a modified version of the Merge from Raw Files example. Warning

The aforementioned Jupyter Notebook is an example, typical production usage would require multi-processing and use rawpy or rawtoaces With the various .CR2 file batches merged, the validation process involves comparing a cherry picked .CR2 file from one of the exposure batches with the corresponding HDRI scaled to absolute luminance and imaged via the DSC Exposure Model using the camera settings of the .CR2 file.