## 3 High-Speed RoI Extraction through Grid Virtual Division
### Grid Virtual Division Scheme  
Rol extraction is the core factor affecting communication performance, but the existing RoI extraction technique is computationally complex and time consuming. Taking these issues into account, we suggested a grid virtual division scheme that improves the efficiency of RoI extraction. Since the light emitted by the transmitter is brighter, the area where the RoI projected by the transmitter in the received image has a higher grayscale value of the pixels than the area where the non-RoI is located. Suppose a pixel with a high grayscale value is retrieved in a certain area, and there are still pixels with a high grayscale value in the positive and negative ten pixels on both sides of the point. In that case, it proves that the area is an RoI area with adjacent symbols. Therefore, the proposed scheme considers using the grayscale values of the pixels in the received image to quickly locate these RoIs. In this section, we employ three shapes of LED luminaire--round, square, and rectangular--as transmitters. The RoI projected by the transmitter carries desired information in a frame, as shown in Figure 4. In more detail, the proposed scheme can be divided into the following four steps, and the flow chart is shown in Figure 5.  
Figure 4: Region of interest projected by transmitters of different shapes in a frame: (**a**) Round LED luminaires. (**b**) Square LED luminaires. (**c**) Rectangular LED luminaires. (**d**) LED luminaires in a variety of shapes. Step 1--Image Chunking: When the CMOS camera receives a whole image containing optical communication information, the proposed scheme first establishes a virtual grid of the original image, as shown in the virtual grid composed of orange dotted lines in Figure 4. Generally, the partition block is divided into \(n\times m\) blocks according to the resolution of the received image. In this section, we establish a grid with the partition size of \(6\times 6\) as an example, as shown in Figure 4. It is worth noting that this step only divides the received image virtually into \(6\times 6\) parts, without traversing the entire image to divide it into \(6\times 6\) subgraphs. This is to make the sampling area smaller while maintaining computational complexity so that blocks with higher grayscale values are found. Step 2--Pixels Sampling: After the virtual grid is established, the decoder randomly samples the grayscale values of several pixels within the block from the uniform distribution. Since the area after grid division is small, if the RoI is located in that area, it is likely to produce a larger area of coverage within the block. Therefore, we sample the pixels in the left, middle and right areas of the middle row in each block to increase the hit rate of RoI detection in the block. To be specific, we first choose to randomly sample a pixel in the left area. If the pixel meets the requirements, we will directly save the block number and continue to process the next block. If the pixel does not meet the criteria, we will continue to perform the same operation in the following area until all three areas are completed. As mentioned before, the grayscale value in the area where the optical signal is concentrated is higher than that in the surrounding area. To better distinguish which sampled pixels are eligible, we set a grayscale threshold empirically so as to maximize recognition accuracy. For comparison with this threshold, in this step, we first store the sampled grayscale values in the collection, which are represented as follows:  
\[R=\{S_{m,n}^{i}\mid 0<i\leq k,1\leq m\leq H,1\leq n\leq W\}, \tag{3}\]  
where \(R\) represents a collection of grayscale values for randomly sampled pixels within different grids, \(S_{m,n}^{i}\) represents the grayscale value of the pixels in column \(n\) of row \(m\) in the \(i\)th block, \(k\) represents the number of blocks divided into the original image, \(H\times W\) represents the resolution size of the original image.