# Performance Analysis of a Color-Code-Based Optical Camera Communication System
## 3 Test and Results
### Effect of Distance between Channels  
As can be seen in Figure 15, the distance between 16 different color channels arranged in a 4 \(\times\) 4 matrix increases horizontally and vertically starting from d = 0. The distance between color channels has a significant impact on communication performance. How many channels a monitor can effectively send data from simultaneously can be determined by appropriately adjusting the distance between the channels. When the channels are too close together, it is difficult for the camera to distinguish colors at a distance.  
To observe the effects of the distance between the channels, a 3 \(\times\) 3 test field with a blue pixel in the center was created. Black, white, red, green, blue, yellow, purple, and cyan  
Figure 14: Variation in the number of erroneous bits depending on data rate and distance.  
Figure 15: Distance between channels: (**a**) d = 0 pixels, (**b**) d1 = 40 pixels, (**c**) d2 = 80 pixels.  
colors were placed around the blue color in the center, and the camera's ability to detect the blue color was tested.  
In Table 3, in the first stage, d = 0 is taken in the case where all color channels are adjacent. In the case where there was black color around the blue color, the camera perceived the blue color in the center as (24, 19, 250) instead of reading (0, 0, 255). Similarly, when there is a yellow color around the blue color in the center, the R, G, B values are perceived as (175, 191, 255) for d = 0, (93, 116, 247) for d = 20 pixels, and (53, 61, 255) for d = 40 pixels. As can be seen, decreasing the distance between channels causes the camera to detect the R, G, B values incorrectly. This is one of the main factors affecting the bit error rate. The tests in Table 3 are repeated for d = 20 pixels and d = 40 pixels for all color values, and the effects of the inter-channel distance on the color detection performance of the camera are shown in detail.  
The (x, y) coordinates are utilized to determine chromaticity. Chromaticity coordinates are normalized with respect to the amount of light. The CIE system is the most commonly employed method for characterizing the composition of any color based on three primary colors. Having a metric that delineates the hue and vividness of a color, independent of light intensity, is beneficial [23; 24]. The x and y values of the color coordinates are obtained from the following equations:  
\[\mathrm{x} =\frac{\mathrm{X}}{\mathrm{X+Y+Z}} \tag{1}\] \[\mathrm{y} =\frac{\mathrm{Y}}{\mathrm{X+Y+Z}} \tag{2}\]  
The R, G, B values in Table 3 were converted to x,y values and then transferred to the CIE xy chromaticity diagram shown in Figure 16. This diagram shows more clearly the amount of misdetection of the original blue color by the camera. When there are different colors around the blue color and the channels are close to each other, there is a significant amount of color shift. For d = 40 pixels, the measurement results are within a narrower region, while for d = 0 they are spread over a very wide region.  
\begin{table}
\begin{tabular}{l|c c c c c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Color**} & \multicolumn{4}{c}{**d = 0 Pixel**} & \multicolumn{4}{c}{**d = 20 Pixel**} & \multicolumn{4}{c}{**d = 40 Pixel**} & \multirow{2}{*}{**d = 40 Pixel**} \\  & **R** & **G** & **B** & **x** & **y** & **R** & **G** & **B** & **x** & **y** & **R** & **G** & **B** & **x** & **y** \\ \hline Black & 24 & 19 & 250 & 0.1534 & 0.0640 & 21 & 20 & 246 & 0.1532 & 0.0651 & 20 & 17 & 255 & 0.1526 & 0.0639 \\ White & 140 & 121 & 255 & 0.2231 & 0.1654 & 100 & 95 & 249 & 0.1947 & 0.1305 & 100 &