# Design and Implementation of a 2D MIMO OCC System Based on Deep Learning
## 3 Description of the Proposed System Architecture
### Receiver
Instead of training a deep neural segmentation network such as CNN, Mask R-CNN, or U-Net, in this study, LED segmentation was performed using adaptive thresholding. We autonomously segmented our foreground and background using adaptive thresholding. Adaptive thresholding evaluates a small group of nearby pixels at a time, computes the \(T\) for that particular local region, and then segments the image. The size of the pixel neighbourhood must be large enough to encompass both background and foreground pixels for local thresholding to be effective. We frequently discover that a variety of neighbourhood sizes produce acceptable outcomes. We are not necessarily pursuing the optimal \(T\) value that will determine the success of our thresholding output. In the arithmetic mean, each neighbourhood pixel contributes equally to the calculation of \(T\). In contrast, the pixel values further from the centre of the region's coordinate system have less of an effect on the overall calculation of \(T\) in the Gaussian mean. The general formula for calculating \(T\) is [41]:  
\[T=mean(I_{L})-C \tag{5}\]  
where the mean is either the arithmetic or Gaussian mean, \(I_{L}\) is the image's local subregion \(I\)and \(C\) is a constant that can be used to adjust the threshold value \(T\). In order to determine the value of the constant \"\(C\)\" in adaptive thresholding, an initial estimation of the constant \"\(C\)\" is conducted, either from zero or estimated from the image characteristics. Subsequently, apply adaptive thresholding to the image, followed by evaluating the segmentation results for false positives and false negatives. Adjust the value of \"\(C\)\" iteratively; decrease it if the threshold is overly strict (false negatives) or increase it if there are excessive details (false positives). Validate the chosen value across multiple images to obtain the optimal constant \"\(C\)\" for optimal segmentation outcomes. The utilization of adaptive thresholding techniques for segmentation purposes is considered to be more advantageous compared to global thresholding techniques. Moreover, LED segmentation based on the adaptive thresholding method can bypass the time-consuming and computationally costly process of training a dedicated CNN, Mask R-CNN, or U-Net segmentation network. Figure 4 illustrates a comprehensive comparison between LED segmentation techniques utilizing simple thresholding and adaptive thresholding methods. Figure 4a illustrates the basic thresholding performance in both indoor and outdoor settings. It is obvious that in the context of outdoor settings, the implementation of basic thresholding resulted in a significant amount of noise, indicating that this particular approach does not exhibit optimal performance across all conditions. In contrast, the LED segmentation technique utilizing adaptive thresholding, as depicted in Figure 4b, exhibits superior performance across all environmental conditions. In addition, we employed a method of image noise filtering based on contouring and size algorithms in order to reduce any noise that may have occurred. A contour refers to a continuous line that connects various points along a border, wherein these points have an identical colour or intensity value. Contours play a crucial role in the determination of the geometry of LEDs. After the implementation of adaptive thresholding on the binary image, the extraction of the contours of the LEDs becomes a straightforward task. Contour separation is a preprocessing methodology commonly employed in digital image analysis to extract and isolate relevant information pertaining to the overall contour of the image. The aim of this study is to distinguish the various features of the contour, which can then be utilized for the purpose of classifying the sample. By identifying the contour precisely, it is possible to obtain precise characteristic samples that facilitate the identification of LEDs. To attain the desired LED configuration, a Gaussian filter is employed on the edges of the contours.