## 4 Results and Discussion
### Preparation of a Color Template and Picture Acquisition  
The experiment was divided into several steps and the procedure is shown in Figure 4.  
The first step was the preparation of the template for color standardization. To determine which colors should be used as a reference, a series of vitamin C solutions was prepared covering the concentration range considered in this study. This was done to estimate the range of RGB values significant for these calculations. Pictures of the tested solutions were taken, and using dedicated homemade software, 12 configurations of RGB values (colors) were chosen to be used on the template. The averaged RGB values formed the basis for determining the color range in the template dedicated to the problem being solved. To slightly expand the color palette, additional upper and lower values were estimated, and the template was created to contain 12 colors. The template, with each color represented by one square, was printed in several copies with one printer. The size of each square was 180 \(\times\) 180 pixels, and the total size of the template was 600 \(\times\) 790 pixels. isolating the photographed objects from the surroundings was placed onto the experimental setup to cut off access to the natural light. Differences in the colors of solutions and the photographed color charts were observed under these two illuminations (Figure 5). The process was repeated 11 times for each sample with a different concentration of vitamin C. All of the pictures were taken with a Xiaomi smartphone (Xiaomi Redmi Note 9, Xiaomi, Beijing, China), which has a 48 MP camera with an f/1.79 aperture. The resolution of the pictures was 3984 \(\times\) 1840 px. To histogram-match the templates used in standardization, additional pictures were taken of the template under both conditions. Templates were cut from the images, and histogram matching was performed between the resulting templates and the original one. The process with the results can be seen in Figure 6. Each template is presented as an RGB image, along with its histograms for each of the R, G, and B channels. This figure clearly illustrates the operation of our algorithm. The first column shows the ideal histogram of the digital color template designed for this task. The color histograms of the template photos are expected to match the ideal characteristics. However, under real conditions, there are significant differences (second and fourth columns) between the histograms of the photos and those of the digital version. However, after applying the algorithm proposed in this work, the expected shape of the color histogram for all three components, R, G, and B, can be reproduced. The graphs in the third and fifth columns match those in the first column. The cumulative histograms of the matched images are the same as the cumulative histogram of the digital template (which serves as the reference) for each channel. Each spike on a given histogram corresponds to one component of a certain color on the template. The less discrete appearance of the histograms of the original template images is caused by variance from printing and different variables that affect how the camera perceives the object with certain changes (e.g., shadows and highlights). Figure 5: Control of lighting conditions—two approaches: natural light (**top**) and smartphone lamp lighting (**bottom**). Right side of an image—digital template used in histogram matching; arrows indicate the lighting condition under which the images were taken. The dataset for the calculations was prepared as follows: 198 pictures were taken fort for nine concentrations of vitamin C under two different lighting conditions. This means that for a given solution for each of the conditions, 11 pictures were taken. Each of the images underwent a process of standardization, as described in Section 3.1.