## 3 Proposed Calibration Process
### Step 2: Image Processing Using the Cyclorama Illumination Analyzer (CYIA)  
The second step is the image processing. The panoramic HDR image is processed using custom software, the cyclorama illumination analyzer (CYIA). This application was developed using C++, making use of OpenCV [29] to handle the HDR images and Windows Forms for the visual user interface. This tool includes different options to configure the processing and the results obtained such as the number of regions in which the image will be subdivided, or the colors used in the visual results. It also includes a visualization area to check the resulting images (Figure 5). The HDR images captured in the first step of the calibration process are composed by three color channels (RGB), while the luminance for each pixel is a single value. Therefore, the analysis must be performed on a monochrome (1 channel) representation of the light probe. The transformation from the original image to the luminance one is done using a weighted average of the three colors channels following the indications of [PERSON] which are based on the ITU-R BT.709 (International Telecommunication Union Recommendation Broadcasting Series Television) [Equation (1)]. \[Y=0.2125\times R+0.7154\times G+0.0721\times B \tag{1}\]  
Then the image is divided into areas of equal luminance. The image subdivision is based on [PERSON]'s median cut algorithm for color image quantization [30]. This procedure divides a rectangular latitude-longitude image in 2n regions with a very similar luminance. The process is the following:  
1. The whole image is introduced as a single region. 2. Each region in the list of regions is subdivided along its larger dimension (latitude or longitude) keeping the same energy (or as similar as possible) in the two new regions. 3. If the number of iterations is lower than n (for 2n regions), repeat step 2. 4. If not, compute the centroid of each region including its position and color. Computationally, the costiliest step is computing the limits of the regions. In order to accelerate the process and make it interactive, a summed area table (SAT) is used [31]. A SAT is a structure that allows the efficient computation of the sum of values in a subgroup of a rectangular two-dimensional matrix, thus speeding up the algorithm. It is a table where the value of every element (\(x,y\)) encodes the sum of all the points located above and to the left, including the point itself (Equation (2)). The computation of a SAT is fast as the value of every element depends only in four elements: the one to the left, the one on  
Figure 5: Cyclorama illumination analyzer user interface. the diagonal to the left, the one above, and the element itself (Equation (3)). Once the table is computed, calculating the weight (in our case the luminance) of any rectangular region is trivial. If we have a region delimited by the vertices A, B, C and D (Figure 6) the weight of that region will be determined by only four values (Equation (4)). \[SAT(x,y)=\sum_{x^{\prime}\leq x,y^{\prime}\leq y}i(x^{\prime},y^{\prime}) \tag{2}\]  
\[SAT(x,y)=i(x,y)+SAT(x-1,y)+SAT(x,y-1)+SAT(x-1,u-1) \tag{3}\]  
\[\sum_{A(x)<x^{\prime}\leq C(x),A(y)<y^{\prime}\leq C(y)}i(x^{\prime},y^{\prime })=SAT(A)+SAT(D)-SAT(B)-SAT(C) \tag{4}\]  
So, the cyclorama illumination analyzer transforms an HDR color image into a luminance one. Then it computes the SAT for that image in order to speed up the subdivision process. Next, the image is divided in 2n regions with the same luminance, being n, a value given by the user. Finally, the centroid position and color for each region are computed. This process is performed both on the captured image and in a perfectly homogeneous version of it, in order to compare the ideal configuration (a perfectly uniform green image) with the actual one present in the set. As the CYIA has the aim of facilitating the process of analyzing the light distribution for nonexperts, a series of 6 images in jpg format (as a visual result) and a set of statistical results stored in a csv file are generated.