A Multi-Feature LED Bit Detection Algorithm in Vehicular Optical Camera Communication

In a vehicular optical camera communication (VOCC) system, digital information is transmitted using LED panels and received using cameras. The transmitted bits are obtained by processing the captured images to detect the ON and OFF statuses of LEDs in the array. In determining the LED status, the current LED bit detection algorithms only rely on the grayscale, which is an unreliable feature of LEDs. Consequently, they exhibit poor performance in unfavorable conditions. The contribution of this paper is the proposed multi-feature LED bit detection algorithm that employs three new features of LED: average greyscale ratio (AGR), gradient radial inwardness (GRI), and neighbor greyscale ratio (NGR). Two features, AGR and GRI, individually have substantially more discriminability of LED statuses than greyscale. More importantly, the three proposed features differentiate LED statuses under different perspectives. Consequently, the combination of the three features using Fisher linear discriminant analysis (FLDA) yields outstanding accuracy and robustness of bit detection, even in severe conditions. Highly realistic simulations of a VOCC system are conducted to verify the superiority and robustness of the proposed algorithm.


I. INTRODUCTION
Vehicular communication is a type of short to medium range communication system that enables safety warnings and traffic information to be exchanged among vehicles [1], [2]. For example, a vehicle can send a signal asking for lane changing and wait for the confirmation signal from other vehicles. In case of emergency braking, an emergency braking signal can be sent to other vehicles. When the vehicles increase or decrease their speed, warning signals are also transmitted to other vehicles through vehicle communication. When using with vehicle tracking, the IDs of vehicles can be sent to other vehicles to build maps of moving vehicles in the street. Along with vehicle tracking and other sensing technologies such as vehicle tracking, lane detection, pedestrian detection, etc., vehicular communication will bring about a safer, more coordinated transportation network, and ultimately enable intelligent transport systems and autonomous vehicle networks. Because of this, vehicular communication has been intensively researched, and in recent years a new technology called optical camera communication (OCC) has The associate editor coordinating the review of this manuscript and approving it for publication was Mohammad Hossein Anisi. emerged as a promising candidate for vehicular communication owing to its many advantages [3]- [10].
In vehicular optical camera communication (VOCC), LED panels on vehicles are used to transmit visible light signals that will be received by cameras installed on front windshields or dashboards of other vehicles. The existing lights of a vehicle, such as head and tail lights (used for illumination purposes), or the daytime running light (DRL), which is used to increase the conspicuity of the vehicle during daylight conditions, can be used as transmitters in VOCC with the implementation of some additional hardware. Cameras, which are used as receivers in VOCC, have also become available in most vehicles in the form of dashboard cameras. The availability of LED panels and cameras on vehicles would reduce the hardware implementation cost of VOCC. One of the major concerns in vehicular communication-interference between vehicles-is alleviated thanks to the line of sight properties of visible light and the spatial separability of cameras. However, the most important feature of VOCC that motivates its use is its great compatibility with other key technologies required for autonomous vehicle network. In near future, vision based technologies such as street lane detection, traffic sign detection, pedestrian detection, and vehicle tracking are likely to VOLUME 7, 2019 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see http://creativecommons.org/licenses/by/4.0/ be implemented in every vehicle. All these technologies use the same cameras and image processing processors required for VOCC [11], [12]. VOCC is especially compatible with vehicle tracking, which is among the most essential parts of an autonomous vehicle network, as major prerequisite steps in vehicle tracking including vehicle image coordinate detection and vehicle identification are already achieved through VOCC [13]. Consequently, using VOCC would significantly reduce the both hardware and software implementation cost for the whole vehicle communication and tracking system compared to using other technologies for vehicle communication.
Although VOCC is a promising technology for vehicular communication, research into VOCC is at an early stage, as the high resolution and high frame rate camera technology that allow the possibility of VOCC has only appeared in recent years. Therefore, many aspects of VOCC have not been thoroughly studied. For example, to attain a fully functioning VOCC system, multiple components including coding, modulation, signal transmitting, signal receiving, data extraction, and decoding must be implemented. Early studies on VOCC attempted to implement all the components to obtain a functioning VOCC system without trying to focus on a single component. For instance, in VOCC, the transmitted bits 1 and 0 represented by the On and Off statuses of LEDs are obtained through an LED bit detection algorithm. Such algorithms in existing studies all use a single feature of the LED (the LED grayscale), and compare it to a predetermined threshold to determine the LED status. However, different vehicles with different LED panels and different cameras result in different grayscales for the same LED status. The problem is exacerbated when even greyscales in the same LED panel are altered owing to LED blooming interference caused by various types of image blurriness. Therefore, the greyscale is far from being a single reliable feature for LED bit detection and greyscale based algorithms have poor performance in unfavorable conditions with the presences of LED blooming interference and varying LED panel greyscales. This paper proposes a novel LED bit detection algorithm in which three new features of LEDs are used to determine LED statuses. To deal with the variation in LED greyscale between panels, the average greyscale ratio (AGR) feature is proposed. To tackle the LED blooming interference caused by image blurriness, the gradient radial inwardness (GRI) and neighbor greyscale ratio (NGR) features are proposed. The two proposed feature AGR and GRI individually have substantially more distinguishability of LED status than the LED greyscale. Furthermore, as the proposed features differentiate LED statuses under a variety of perspectives, a combination of all three features using the Fisher discriminant analysis (FLDA) will even boost the LED status distinguishability to a greater level and imparts an outstanding robustness against LED greyscale variation and LED blooming interference caused by image blurriness. A novel scheme is proposed to make highly realistic simulations to verify the performance of the proposed algorithm.
The results reveal that the proposed LED bit detection algorithm significantly improves the bit error rate (BER) in all situations of the communication channel.

II. FUNDAMENTAL OF VOCC SYSTEM A. SYSTEM ARCHITECTURE
The system architecture of a VOCC system is presented in Fig. 1. At the transmitting side, after error correction coding and modulation, the digital bits 1 and 0 are conveyed by the On and Off statuses of LED chips in the LED panel. At the receiving side, the image of the LED panel is processed to extract the embedded data, which is then decoded to obtain the original data. As shown in Fig. 1, the image processing component in turn includes two smaller components: LED panel detection and LED bit detection. In the literature, these two components are referred to by the same terminology: LED detection. This is misleading as these two kinds of detection have different purposes, use different classes of algorithm, and must be processed separately with LED bit detection strictly following LED panel detection. Figure 2 illustrates the difference between the two kinds detection. In LED panel detection, the entire image is processed to detect the coordinates of LED panels in the image. Subsequently, in LED bit detection, the detected LED panels are examined closely to find the On or Off status of each LED chip in the panels. These statuses are then translated to the logical bits 1 and 0. Then after error correction decoding step, the original transmitted data is obtained. This study only focuses on the LED bit detection algorithm, which is needed to achieve a high BER in VOCC. In the presentation of the proposed LED bit detection algorithm in section III, the coordinates of LED panels are assumed to have been obtained beforehand. In the simulation, the coordinates of LED panels are obtained using a simple proposed LED panel detection algorithm.

B. EXISTING LED BIT DETECTION ALGORITHMS
In principle, detecting the On and Off status of LEDs in a clear image is easy once the LED panel is located. As described in Fig. 3, the status of each LED chip can be determined simply by comparing the grayscale of each LED chip to a threshold. Note that in [3]- [9], the greyscale of LED is referred by the terminology 'intensity' or 'luminance'. In [3]- [5], by using a self-developed image sensor, LED panel images are binarized by comparator circuits and thus the output from the camera are black-white images in which On LEDs are white while Off LEDs and all other objects with lower luminance are black. The threshold for the inchip binarization is determined automatically. This process is a proprietary information which is not mentioned clearly in these studies. However, it is suggested that the luminance of LED should be far higher than that of other objects in the background for the binarization to work properly. In [6], the output grayscale image is binarized using a predetermined threshold. The value of the threshold is the lowest greyscale value of On LEDs in prerequisite testing images. In [7]- [9], to reduce the effect of greyscale variation between frames, the greyscale of LED in the range from 0 to 255 is normalized to the range from −1 to 1 using a fixed standard value. This standard value is determined as the maximum greyscale of prerequisite testing white LED panel in which all LEDs are On. Since the greyscales are scaled into the range from −1 to 1, the threshold for discriminate On and Off LEDs is zero. In [10], the effect of greyscale variation between frames is effectively eliminated by repeatedly measuring the greyscale of On and Off LED through preamble frames. Therefore, the threshold can be updated after every 1000 frames. As earlier mentioned, none of these studies focus on LED bit detection and thus simulations and experiments in these studies were conducted in controlled environments favorable to LED bit detection. Therefore, a simple grayscale comparison-based algorithm is sufficient for achieving a decent BER. However, in unfavorable conditions, the variation of greyscale and especially the LED blooming interference make LED greyscale become unreliable and lead to high BER.

C. SOURCES OF ERRORS IN LED BIT DETECTION 1) VARIATION IN GREYSCALES BETWEEN FRAMES
The greyscale value G at a pixel in the image sensor at a given ISO speed S set by the camera is determined as [14]: where H is the luminous exposure, which corresponds to the amount of light coming to the pixel, H SOS = 10/S is the indicated luminous exposure required at the ISO speed S to achieve the greyscale value 118, and γ is the gamma value used for gamma encoding. The light coming from an Off LED to the image sensor is the ambient light reflected from the LED surface. Therefore, the luminous exposure of an Off LED pixel is given by [14]: where E v is the illuminance of the ambient light, R is the reflectance of the LED surface, t is the exposure time of the camera, N is the f-number of the lens, and K is the reflectedlight meter calibration constant determined by camera manufactures. The light coming from an On LED to the image sensor is the combination of the light emitted by the LED and the ambient light reflected from the LED surface. Therefore, the luminous exposure of an On LED pixel is given by [14]: where L v is the luminance of LED. From Eq. (1), (2), and (3), the greyscales of On and Off LEDs are determined by many factors that might vary greatly in different vehicles and different situations. As illustrated in Fig. 4, the greyscales of the On LED in Fig. 4a are even lower than those of the Off LED in Fig. 4b. Therefore, there is no fixed threshold that can be used to correctly distinguish LED statuses of every vehicle in every situation.

2) LED BLOOMING INTERFERENCE DUE TO IMAGE BLURRINESS
Many imperfections in image acquisition might introduce blurriness to the captured LED images and invalidate the greyscales. The two major imperfections are Airy diffraction and optical aberrations. The former is an unavoidable phenomenon caused by the wavelike nature of light; it produces fringes of light extending from the borders of objects in the captured image. Its effect can be mathematically described as convolving the incoming image with an Airy disk diffraction   pattern, as shown in Fig. 5. The latter is a distortion in the image formed by faults in lens production. Similar to Airy diffraction, optical aberrations cause the light to be spread out over a region rather than focused to a point, hence creating image blurriness.
The critical consequence of image blurriness is LED blooming interference, as shown in Fig. 6. Because of the interference, the greyscales of an LED might be severely altered by its neighbor LEDs. For example, the Off LED in the 7 th row and 7 th column in Fig. 6a is severely affected by the interferences from its neighbor LEDs in Fig. 6b and thus can be easily miss-detected as an On LED.

III. PROPOSED MULTIPLE FEATURES LED BIT DETECTION ALGORITHM A. PROCEDURE OF LED FEATURE EXTRACTION
The procedure for extracting LED features is described in Fig. 7. First, the location of the entire LED panel in the image is determined using an LED panel detection algorithm. The output of this algorithm is a convex hull, which is the minimum convex polygon containing the entire LED panel region. In this study, the LED panel is assumed to have a rectangular shape. Therefore, the obtained convex hull is a quadrilateral or, in most cases, also a rectangle. Given that the number of LEDs in the array is known, the entire region of the LED panel is divided into the same number of equal sub-regions. In Fig. 7, the LED panel contains 8 × 8 LEDs; hence, the LED panel is divided into 8 × 8 equal sub-regions. Each of these sub-regions is considered the region of an LED in the array. Once the region of an LED is determined, features of that LED can be obtained from pixels inside the LED region and neighboring LED regions.
Two aspects regarding the procedure described above need to be explained. First, because of the small size, it is difficult to detect a single LED in the image directly. Furthermore, it is almost impossible to detect an LED directly when it is turned Off. However, it is easier to detect the entire LED panel owing to its bigger size and the presence of On LEDs inside the panel with high luminance stand out against the image background. Therefore, the region of each LED can only be obtained indirectly by dividing the detected LED panel region, as shown in Fig. 7. The area of each LED region is proportional to the size of the LED panel. Consequently, as long as the LED panel is detected, the regions of LEDs in the panel are always determined regardless the size of LEDs. Second, it is a requirement to know the number of LEDs in the array for the region division. In practice, this number must be a fixed number specified in a standard for VOCC. In addition, this number can be easily obtained through preamble frames that are required for establishing the communication channel between two vehicles. Therefore, in this study, a fair assumption is made that the number of LEDs in the array is known beforehand.

B. LED FEATURES FOR BIT DETECTION
To choose the right features of the LED for bit detection, one needs to determine the features that would indicate the differences (as much as possible) between On and Off LEDs. The chosen features also need to overcome problems such as LED greyscale variation and LED blooming interference. Based on these criteria, three features of LEDs are proposed: average greyscale ratio (AGR), gradient radial inwardness (GRI), and neighbor greyscale ratio (NGR).

1) AVERAGE GREYSCALE RATIO
The most basic difference between On and Off LEDs is their greyscale. Therefore, the average greyscale of pixels in the entire LED panel needs to be considered. To account for the variation in greyscale between frames, the average greyscale ratio (AGR) feature is used.
The average greyscale ratio is formally defined as follows: where G led is the average greyscale of the LED and G panel is the average greyscale of the entire LED panel.
Note that since the average values of LED and LED panel are used in Eq. (4), the discriminability of AGR is not affected by the size of LEDs. The superiority of AGR over average LED greyscale is illustrated in Fig. 8. Fig. 8a shows 20 frames selected from 100 sample LED panel frames simulated at   Fig. 8c. It is obvious that LED AGR has much higher discriminability for a feature to distinguish LED status.

2) LED GRADIENT RADIAL INWARDNESS
As mentioned previously, the greyscale of an LED is affected by neighboring LEDs owing to LED blooming interference. To deal with this problem, the impacts of neighboring LEDs are measured and utilized as features for distinguishing LED statuses. There are two proposed measurements for the impacts of neighbor LEDs: direct and indirect. This section presents the direct measurement of the impact of neighbor LEDs -gradient radial inwardness (GRI).
The idea behind GRI is the difference between the image gradient vectors inside On and Off LED regions. Image gradient vectors represent the directional change in the greyscale of an image; it is calculated as follows: where f (x, y) is the greyscale at the coordinate (x, y) in the image, and DX and DY are partial derivatives of the image greyscale in the horizontal and vertical dimension, respectively: Image gradient vectors in an image point from dark pixels to bright pixels. Therefore, an On LED should have gradient vectors pointing inward, while an Off LED should have gradient vectors pointing outward, as shown in Fig. 9a. The difference in the overall direction of gradient vectors of On and Off LEDs can be measured by the gradient radial inwardness (GRI), which is defined as follows: where ∇f (x, y) is the gradient vector in each pixel inside the LED region, (·) represents the dot product operation, and r(x, y) is the normalized radial inward vector at the corresponding pixel given by where (x c , y c ) is the coordinate of the center pixel of the LED and v denotes the magnitude of the vector v. In other words, normalized radial inward vectors are unit vectors with a magnitude of one and the direction pointing to the LED center as shown in Fig. 9b. The idea behind Eq. (7) is that the dot product of two vectors is positive when they are codirectional and negative when they are contradirectional. As shown in Fig. 9c, the On LED in the left frame has gradient vectors and normalized VOLUME 7, 2019 radial inward vectors at each pixel pointing in the same direction, and thus tends to have a positive GRI. On the other hand, gradient vectors and normalized radial inward vectors at each pixel in the Off LED in the right frame point in opposite directions, thus making the GRI of this LED negative. Considering the variation of the size of LEDs, the GRI feature is normalized by dividing summation of the dot products of the gradient vectors and the radial inward vectors at all pixels inside the LED region by the number of pixels inside the LED region. Figure 10a shows the distribution of the GRI of On and Off LEDs in 100 sample frames that were previously shown in Fig. 8a. It can be seen that the GRI has a very good discriminability as an LED feature. Most of the On and Off LEDs can be distinguished by comparing the GRI alone. However, a remarkable discriminant only appears when the GRI and AGR are combined. All LEDs whose statuses cannot be determined conclusively by either the GRI or AGR alone can be distinguished by looking at the GRI and AGR simultaneously, as shown in Fig. 10b.

3) NEIGHBOR GREYSCALE RATIO
The impact of neighboring LEDs can be measured indirectly as the average greyscale of eight neighboring regions, as shown in Fig.11. As the greyscales of neighboring LEDs also vary from frame to frame, the neighbor greyscale ratio (NGR) is used: where G 8nb is the average LED greyscale of eight neighboring regions and G panel is the average LED greyscale in the panel. Note that the eight neighboring regions might be LED or background regions. As shown in Fig. 11, the LED in the seventh row and seventh column of the panel has all eight LED neighboring regions. On the other hand, the LED in the third row and first column of the panel has five LED neighboring regions and three background neighboring regions. In either case, the greyscales of all pixels in the eight neighboring regions are counted in the same way when calculating the average LED greyscale G 8nb . Similar to the case of AGR, average values of neighboring LEDs and LED panel are used to calculate NGR and thus the discriminability of this feature is not affected by the size of LEDs.
The distribution of the NGR of On and Off LEDs in 100 sample frames shown in Fig. 8a is shown in Fig. 12a.
It appears that the NGR alone is a bad feature for distinguishing LED status as the distributions of the NGRs of On and Off LEDs completely overlap each other. However, since NGR describes the characteristics of LEDs under a different perspective to AGR and GRI, the addition of NGR to the other two features still can improve the discriminability of On and Off LEDs as shown in later figures in Fig. 12. In Fig. 12b, the addition of NGR to AGR provides a better separation between On and Off LEDs compared to that provided by AGR. The discriminability of the combination of the NGR and GRI is also better than that of GRI alone as shown in Fig. 12c. Consequently, the highest discriminability is achieved when all three features (AGR, GRI, and NGR) are combined, as shown in Fig. 12d. Note that since the discriminability of the combination of AGR and GRI shown in Fig. 10b is very good already and the 3-dimensional distribution of three features AGR, GRI and NGR is plotted in 2-dimensional figure, the improvement of the addition of NGR is not clearly shown in Fig. 10b. The benefit of adding NGR will be shown clearer in the simulation of this paper.

C. BIT STATUS CLASSIFICATION USING THE FISHER LINEAR DISCRIMINANT ANALYSIS 1) PRINCIPLE OF THE FISHER LINEAR DISCRIMINANT ANALYSIS
The Fisher linear discriminant analysis (FLDA) is a method used in statistics and machine learning to find the combination of features needed to separate two or more classes of objects [15]. The idea of this method is described in Fig. 13.
This method requires a training data set in which all objects are classified into two or more classes as shown in Fig. 13a. Given an arbitrary n−dimensional vector w, where n is the number of features of each object, the projection of every object x in the training set to w is given as follows: where (·) denotes the dot product. Let µ 0 and µ 1 denote the means of projections of objects in class 0 and class 1 on w, respectively: where i = 1, 0 and m i are the means of objects in class i. Let σ 0 and σ 1 denote the variances of the projections of objects in class 0 and class 1 on w, respectively: where S i is the set of all objects belonging to class i in the training set. The goal of FLDA is to find a discriminant vector w so that the variance of the projections of objects between classes is a maximum and the variance of the projections of objects within classes is a minimum, as illustrated in Fig. 13b. In other words, the goal of FLDA is to find a vector w that maximizes the ratio: where (µ 0 −µ 1 ) 2 is the variance between classes and (σ 0 +σ 1 ) is the variance within classes. The discriminant vector w that maximizes G(w) in Eq. (10) is given as where S w is the covariance matrix within classes calculated as  The covariance matrix within classes S w is calculated as where C i is the 3 × 3 covariance matrix calculated from all LED feature vectors in the set S i : where σ x i ,x j is the covariance between two features x i and x j of the LEDs in set S i . Using Eq. (14), the discriminant vector w is obtained. Then, the status detection for an LED with the extracted feature vector u in an input frame is given as where thres is the mean of the projections of all LED feature vectors in set S: With the 100 sample frames shown in Fig. 8a, the discriminant vector w that separates the On and Off LEDs best is found and shown in Fig. 14.

A. SIMULATION PROCEDURE
The simulations are conducted using Matlab version 2017b. The simulation procedure is shown in Fig. 15. In the training phase, a set of 1000 LED panel sample frames is generated to build the training set. The LED panel in each frame consists of 8 × 8 LEDs. The bit values of the LEDs in each frame are randomly generated with uniform distribution. Assuming that the On-off keying (OOK) modulation is used, the Off and On statuses of the LEDs are used to convey the logical bits 0 and 1, respectively. All these 1000 frames are processed with an LED panel detection algorithm that will be presented in the next few sections. Given the location of the panel in each determined frame, three features of every LED in each frame, including AGR, GRI, and NGR, are extracted to create the feature vector x. Given the bit values of the LEDs in all the known frames, two sets of LED feature vectors S 0 and S 1 corresponding to Off and On LEDs are created. Then, FLDA is applied to find the discriminant vector w and the threshold value thres that will be used to determine the bit values of input LED panel frames.
In the testing phase, testing frames are generated with specific simulation setups. These testing frames are also processed with LED panel coordinate detection and LED feature extraction algorithms to obtain the feature vector u of every LED in each testing frame. Using the discriminate vector w and threshold value thres obtained in the training phase, the bit value of each LED is determined. Then, the bit error rate (BER) is calculated to evaluate the performance of the proposed LED bit detection algorithm.
In practice, error correction codes might be applied to reduce the BER of the communication system. In this paper, to provide the actual performance the proposed bit detection algorithm, no error correction code is applied in the simulation. Therefore, the BER obtained in the simulation is the actual BER of the proposed bit detection algorithm.

B. ADDITIONAL PROPOSED ALGORITHMS FOR SYSTEM SIMULATION 1) A NOVEL REALISTIC LED PANEL IMAGE REPLICATION METHOD
As mentioned previously, the major sources of errors in LED bit detection are the variations in LED greyscales and the LED blooming interference caused by image blurriness. To provide a fair evaluation of the proposed LED bit detection algorithm, it is important to have a realistic LED panel frame replication method in which the greyscales of the LEDs and the LED blooming interference caused by image blurriness are replicated properly.
The proposed LED panel image replication algorithm includes the two steps shown in Fig. 16. In the first step, given the size and position of LEDs in the array and camera parameters (such as sensor physical size, resolution, lens focal length, and camera pose), the regions of the LEDs in the image sensor can be determined using the pinhole camera model [16] shown in 16a. In the second step, the series of transmitted bits in the LED panel is randomly generated first. Then, this series of digital bits is translated into a series of corresponding LED statuses. Given the statuses of LEDs in the panel, the luminous exposures on the regions of the LEDs in the image sensor are calculated, and the LED blooming interference is replicated to create a realistic greyscale image of the LED panel. The novel aspect of the proposed LED panel replication algorithm is the realistic LED blooming interference replication scheme shown in Fig. 16b.
In the field of graphic and game design, image blurriness and blooming interference are usually replicated by applying a Gaussian filter to the input image [17]. The Gaussian filter itself can replicate the blurriness and blooming interference very well, given that the information about luminous exposure of the image is preserved. The problem is that images subjected to Gaussian filtering in existing schemes have gone through a gamma encoding step, which causes information about luminous exposure to be lost. Because of this, the Gaussian filter applied in the Gamma encoded image will not correctly replicate the blurriness and LED blooming interference of the LED image.
In the proposed scheme, given parameters including LED luminance, ambient light illuminance, and camera exposure setting, the luminous exposure received by every pixel in the image sensor is calculated using Eqs. (2), and (3). The result is a 2-dimensional matrix of luminous exposure corresponding to the amount of light received in the entire image sensor. Gaussian filters are then applied to the luminous exposure matrix to replicate the realistic blurriness and blooming interference effect. Given the camera ISO speed setting and the gamma encoding value, the greyscale values at every pixel are calculated using Eq. (1) to create a greyscale image of the LED panel. As the Gaussian filter is applied before the Gamma encoding step, no required information for the Gaussian filter is lost; hence, the blurriness and blooming interference effects can be replicated in a realistic way.
The differences between the existing and proposed blurriness results and LED blooming replication schemes are shown in Fig. 17. With the existing schemes, the loss of luminous exposure information causes a loss of the LED greyscale and the replicated image would appear duller, as shown in Fig. 17a. With the proposed scheme, there is no loss in the LED greyscale, and the replicated image appears as bright as it should appear in reality, as shown in Fig. 17b.   FIGURE 17. Difference between the existing and proposed blurriness replication scheme.

2) A NEW SIMPLE LED PANEL DETECTION ALGORITHM
Even though LED panel detection is not the focus of this study, such an algorithm is required in the simulation to obtain the coordinates of the LED panel in replicated images. Existing object and vehicle detection algorithms are not used in the simulation since they are too complicated for LED panel detection. Given the special characteristics of LED panels (such as high luminance, compact size, and rectangular shape), a new simple algorithm is proposed to detect the coordinates of the LED panel, as shown in Fig. 18. First, a binarization algorithm is used to convert a greyscale input image to a binary image. Given that the background has a much larger area with a lower greyscale in the image compared to the LED panel, a threshold separating the background greycales and LED panel greyscales can be determined using Otsu's method [18] as shown in Fig. 19. Note that this step can be done easily in the simulation since the replicated LED panel image does not have a complicated background with many objects having different luminances. Using this threshold, the input image is converted into a binary image. Then, a morphologically close operation [19] is applied to fill holes inside the LED panel. Subsequently, a flood-fill algorithm [20] is used to detect all connected components, which contains LED panels and other objects with high luminance in the binary image. Using binary large object (BLOB) analysis [21], LED panels with high compactness and rectangularity characteristics can be distinguished from other noise objects. The convex hull of the detected LED panel then can be obtained and input to the LED feature extraction algorithm. In the simulation, most of components in the LED panel detection algorithms are implemented using available functions in Matlab version 2017b.
Note that the LED panel detection algorithm presented above is not meant to be applied in all scenarios of LED panel detection, especially when the image has a complicated background and several high luminance objects. Those scenarios require a more sophisticated LED panel detection algorithm, which is beyond the scope of this study.

C. SIMULATION ENVIRONMENT
The simulations were conducted with parameters described in Table 1. A 1-inch (13.2mm × 8.8mm) sensor with Full-HD (1920 × 1080 pixels) video recording was assumed. The focal length of the lens was assumed to be 18 mm. The frame rate of the camera was assumed to be 100 fps. To avoid a motion blur effect on the image, a very short exposure time of 1/1500 s was assumed. Regarding the LED panel, the LED was assumed to have a circular shape with a diameter of 3 cm. The inter-distance between LEDs in the array was 3 cm. The LED panel was assumed to consist of 8 × 8 LEDs, and the LED luminance ranged from 2000 to 4000cd/m 2 . This is a normal range for LED headlights and LED daytime running lights. The reflectance of the LED surface was assumed to be 0.4, which is the average reflectance of a clear plastic material. The illuminance of ambient light ranged from 1000 to 32000 lux, which corresponds to the lighting conditions in an overcast to bright sunny day. The average reflectance of the background was assumed to be 0.18, which is the average reflectance of middle grey objects. The testing communication distance in the simulation ranged from 30 to 70 m. Finally, the blooming and blurriness level of replicated images in the simulation was assumed to be 1.5 pixels.
In the VOCC system, the net data rate is the product of the frame rate of the camera and the number of transmitted bits per frame. In the simulation, a fixed net data rate of 6.4 kbps was assumed. It is important to note that the ISO of the camera in the simulation is assumed to adjust automatically according to the ambient light illuminance. More specifically, given the ambient light illuminance, the ISO is adjusted between 100 to 3200 so that the greyscale of the background has a random value between 86 and 118 (which corresponds to a half of the middle grey to middle grey greyscale). This is because the captured image might not only be used for VOCC system but also for lane, pedestrian, traffic sign, and other kinds of object detection required for autonomous vehicles. The auto ISO mechanism would ensure sufficient greyscale levels for all objects in the image to be detectable.
In the simulation, the impact of system parameters on the BER of the proposed LED bit detection algorithms were examined. These parameters included LED luminance, ambient light illuminance, communication distance, and contrast level. To obtain the BER corresponding to a specific value of a testing parameter, 2000 LED panel images were replicated and tested with the proposed LED bit detection algorithm. To provide a fair evaluation of the impact of the testing parameter at a specific value, the values of other system parameters in 2000 replicated LED panel images are set randomly. For example, to obtain the BER of the proposed algorithm at the ambient light illuminance of 1000lux, the values of LED luminance and communication distance in 2000 replicated images are all different. Consequently, the obtained BER can be considered as the actual average performance of the proposed algorithm at the ambient light illuminance of 1000lux in all situations.
Two versions of the proposed bit detection algorithm are implemented in the simulation. The first one uses FLDA with two proposed features namely AGR and GRI. The second one uses FLDA with all three proposed features. The reason for this is because the combination of AGR and GRI provides a very good discriminability of LED statuses as shown in Fig. 10b. The comparisons between the performances of the proposed algorithm using two and three features would give the insight on how much improvement the third feature namely NGR can provide to AGR and GRI.
As explained earlier, existing works on VOCC did not focus on LED bit detection and thus favorable conditions for bit detection such as fixed LED luminance and fixed ambient light illuminance are assumed in their experiments and simulations. Consequently, most of simple greyscale based LED bit detection algorithms used in these works cannot handle the variation of LED greyscale between frames. In the simulation in this paper, LED luminance and ambient light illuminance both have wide ranges and thus the LED greyscale varies greatly between frames. Among existing greyscale based algorithms, only the adaptive greyscale algorithms in [10] by design can deal with the LED greyscale variation thanks to the use of preamble frames. Therefore, the performance of the proposed algorithms was compared with those of adaptive LED average greyscale and adaptive LED center greyscale bit detection algorithms. In both algorithms, only the LED greyscale is used to determine the LED status. The average greyscale of the LED is used in the former, while in the later the greyscale of the center pixel of the LED is used. The adaptive threshold is obtained as the average greyscale of preamble frames of which LEDs in the entire panel are all On or Off. In practice, the preamble frames can be transmitted every 1000 consecutive frames given that the lighting and camera exposure settings do not change much during that period. In the simulation, the lighting and camera exposure settings were changed randomly in each testing frame. Therefore, in the simulation, two On and Off preamble fames were generated with every testing frame using the same lighting and camera exposure settings to calculate the adaptive threshold value.
In the literature, the transparency of the air is measured via visibility distance and the impact of the air on optical communication is measured via transmission coefficient. Given a weather condition with visibility distance L vis , the transmission coefficient T (L) at a communication distance L is determined as [22]: It is important to note that visibility distance is measured by meteorological definitions [22]. Therefore, a visibility distance of L vis does not directly indicate that an LED chip or any specific object can be seen by naked eyes at L vis . According to [22], [23], the visibility distance in clear VOLUME 7, 2019 weather condition ranges from 39.5 to 50km. In this paper, clear weather condition is assumed, and the visibility distance is assumed to be 40km. Consequently, the transmission coefficient at 70m, which is the maximum communication assumed in the simulation, is 0.9932.

1) IMPACT OF LED GREYSCALE CONTRAST ON BER
Basically, On and Off LEDs can be distinguished because the greyscales of On LEDs are higher than those of Off LEDs. The contrast between On and Off LEDs is a factor that directly affects the BER of bit detection algorithms. As explained in sectionII-C.1, the greyscales of Off LEDs are determined by the ambient light illuminance while those of On LEDs are determined by both ambient light illuminance and LED luminance. When the LED luminance is low compared to the ambient light illuminance, the contrast is low. Conversely, when LED luminance is high compared to the ambient light illuminance, the contrast is high. Figure 20 shows two LED panel images with the contrast of 6%, 30%, and 50%. The contrast is calculated as the ratio between the difference between the greyscales of On and Off LEDs over the maximum greyscale of 255. The low contrast of 6% shown in Fig. 20a results from the high ambient light of 32000 lux and the low LED luminance of 500cd/m 2 . The middle contrast of 30% shown in Fig. 20b is obtained with the middle ambient light illuminance of 4000 lux and middle LED luminance of 3500cd/m 2 . Finally, the high contrast of 50% shown in Fig. 20c is produced by the low ambient light illuminance of 1000 lux and high LED luminance of 4000cd/m 2 .   Fig. 20a, the contrast is very low and it is obvious that all bit detection algorithms would have difficulties dealing with this image. Therefore, the simulation results in this paper can provide a fair evaluation of the performance of the proposed bit detection algorithm.
One important aspect to notice from Fig. 20 is the increase in LED blooming interference as the contrast increases. This is because the contrast increases when the LED luminance increases compared to the ambient light illuminance (that is when the ratio of LED luminance to ambient light illuminance increases). As the blooming interference increases when the LED luminance increases, an increase in the contrast would occur with an increase in the LED blooming interference. It is the simultaneity of the two factors that explains the non-monotonic manner of the BER change at different contrast levels in the simulation result shown in Fig. 21. To examine the impact of contrast on BER, 20000 LED panel images were generated with the ambient light illuminance randomly set between 1000 and 32000 lux, the LED luminance randomly set between 500 and 8000 cd/m 2 , and the communication distance randomly set between 40 and 60 m. The results reveal that the LED greyscale contrast in these 20000 images ranges from 6% to 54%. The BER at different ranges of LED greyscale contrast is shown in Fig. 21. In principle, when the contrast increases, the On LEDs are more differentiable from the Off LEDs. Therefore, the performances of all bit detection algorithms in Fig. 21 initially increase as the contrast increases. However, as the contrast exceeds certain optimal levels depending on the algorithms, the performances of these algorithms start to deteriorate as the contrast increases. This is because the simultaneity of the contrast and the LED blooming interference mentioned above. As the contrast exceeds the optimal level, the negative effect of the LED blooming interference exceeds the positive effect of the contrast and causes a decline in the performance of the bit detection algorithms. Figure 21 also shows the superiority of the proposed algorithms over the greyscale based algorithms at all contrast levels. Regarding the performance difference between the two versions of the proposed algorithm, the figure shows that the addition of the third feature NGR does improve the detection accuracy. On average, the BER of the proposed algorithm using all three features is 11% lower than that using two features. At contrast levels from 30 to 36%, the addition of the third feature helps reduce the BER from 5.3e-4 obtained using two features to 3.9e-4, which is equivalent to 26% increase in detection accuracy.
As the contrast is mutually determined by the ambient light illuminance and LED luminance, the performance of bit detection algorithms is also contingent on these two parameters. Figure 22 shows the BERs of the proposed algorithms and the other two greyscale based bit detection algorithms corresponding to different ambient light illuminance. In this simulation, the ambient light illuminance ranges from 1000 to 32000 lux. At each level of ambient light illuminance, 2000 LED panel images are generated with LED luminance randomly set between 2000 and 4000 cd/m 2 and communication distance randomly set between 40 and 60 m. The results reveal that there are optimal values for the ambient light illuminance where the bit detection algorithms achieve the lowest BERs. The optimal value of ambient light illuminance for the two greyscale-based algorithms is approximately 4000 lux, while that of the proposed algorithm is 8000 lux. This is because the presence of these optimal ambient light illuminances is due to a decrease in both contrast and LED blooming interference as the ambient light illuminance increases. More specifically, when the ambient light is low, the ISO is set to a high value to amplify the small amount of ambient light received by the camera. Consequently, the LED light is amplified significantly, resulting in high levels of contrast and interference. When the ambient light is high, the ISO is set to a high value, and the LED light is only amplified slightly, resulting in low levels of contrast and interference. Therefore, from the ambient light illuminance of 1000 lux, the decrease in BERs as the illuminance increases is due to a decrease in LED blooming interference. From the ambient light illuminance of 32000 lux, the decrease in BERs as the illuminance decreases is due to an increase in contrast. Figure 22 also shows that the BER of the proposed algorithms are much lower than those of their counterparts at all levels of ambient light illuminance. Besides, it is shown that the proposed algorithm using all three features has better performance compared to one using two features. At ambient light illuminance levels of 8000lux, the BER of 6.6e-4 is reduced to 5.0e-4, which is equivalent to 24% increase in detection accuracy.

3) IMPACT OF LED LUMINANCE
The impact of LED luminance is shown in Fig. 23. In this simulation, the LED luminance ranged from 500 to 8000 cd/m 2 . At each level of LED luminance, 2000 LED panel images were generated with the ambient light illuminance randomly set between 4000 and 8000 lux and the communication distance randomly set between 40 and 60 m.
The results reveal that the BERs of all the algorithms are lowest at the LED luminance of 4000 cd/m 2 . It is obvious that the higher the LED luminance is, the higher the levels of contrast and LED blooming interference. Therefore, when the LED luminance increases from 500 cd/m 2 to 4000 cd/m 2 , the BERs decrease owing to an increase in contrast. After the LED luminance exceeds 4000 cd/m 2 , the BERs increase due to increases in LED blooming interference. Figure 23 also shows that the BERs of the proposed algorithms are much lower than that of their counterparts at all levels of LED luminance. The BER of the proposed algorithm with three features is also shown to be better than that using two features. At the LED luminance level of 8000cd/m 2 , the addition of the third feature gives the improvement of 18% of the achieved BER.

4) IMPACT OF COMMUNICATION DISTANCE
The BER at different communication distances is shown in Fig. 24. In this simulation, the communication distance ranged from 30 to 70 m. At each communication distance, 2000 LED panel images were generated with the ambient light illuminance randomly set between 4000 to 8000 lux and the LED luminance randomly set between 2000 and 4000 cd/m 2 . As expected, the BERs of all the algorithms FIGURE 24. BER at different communication distances. VOLUME 7, 2019 increase as the distance increases. This is because when the distance increases, the LED panel becomes smaller in the captured image, and the LED blooming interference becomes more severe. It is this increase in LED blooming interference that is responsible for the increase in the BERs of all the algorithms when the communication distance increases. Nevertheless, at all distances, the BERs of the proposed algorithms are still much lower than that of the LED greyscalebased algorithms. The performance of the proposed algorithm using three features is also shown to be better than that using two features. At the communication distance of 30m, the improvement of the detection accuracy gained from the addition of the third features NGR is 30%.

5) IMPLICATION OF THE SIMULATION RESULTS AND DISCUSSIONS
The first aspect that needs discussing is the computational complexity of the proposed algorithm. Figure 25 shows the normalized processing time of different algorithms used in the simulation. Since the actual processing times of these algorithms are likely to change when implimented in different computers, the normalized processing times in percentage scale are shown to give the idea about the differences in computational complexity of these algorithm regardless the used computers. As explained earlier, two image processing steps including LED panel detection and LED bit detection are needed for extracting the transmitted data in VOCC. In the simulation, both kinds of detection are implemented. Therefore, the processing time of LED panel detection algorithm is reported besides that of LED bit detection algorithms. The results show that LED panel detection (PanelDet) algorithm has much longer processing time compared to bit detection algorithms. More specifically, the processing time of the proposed algorithm using three features (3Features) is only 14% of that of the LED panel detection (PanelDet) algorithm. The processing times of the proposed algorithm using two features (2Features), the adaptive average greyscale (AvgGs), and the adaptive center greyscale (CenterGs) are 12%, 7%, and 5% of that of the LED panel detection algorithm, respectively. Note that the time for processing the preamble frames to calculate the LED greyscale threshold is not counted when calculating the processing time of greyscale based algorithms since preamble frames are received once in every 1000 or more frames in practice.
Regarding the two version of the proposed algorithm, the processing time of the version using three features is 17% larger than that of the version using two features. While 17% is not a big difference, it is also not negligible. However, considering that the processing time for bit detection is small compared to that for LED panel detection and other steps in the receiving side in a VOCC system, the difference in the computational complexity when using two versions of the proposed algorithm is negligible. For example, when considering the total time for image processing in VOCC, which include LED panel detection and LED bit detection, the version using three features increases the total image processing time by only 1.78% compared to the version using two features. Therefore, while a choice to use which version of the proposed algorithm can be made based on the priority of particular VOCC systems, it would be a better decision in most cases to implement the proposed algorithm with all three LED features even though the average performance gain is only 11%.
The second aspect to discuss here concerns the novel finding from the simulation results. In an OCC system, the relationship between LED luminance and ambient light is usually considered as the relationship between signal power and the noise source. Therefore, the performance is expected to increase monotonically when the LED luminance increases compared to the ambient light illuminance. However, the simulation results show a non-monotonic relationship between BER and these two parameters. This is because the BER is dependent on both the contrast between On and Off LEDs and the LED blooming interference. When the LED luminance increases compared to the ambient light illuminance, both the contrast and LED blooming interference increase. Because of this simultaneity, there are optimal contrast levels where the performances of the bit detection algorithms are optimal. As the ambient light is uncontrollable, the optimal contrast can be obtained by choosing an optimal LED luminance corresponding to each level of ambient light illuminance.
In this study, the LEDs are not dimmable, which is also the case for most commercial vehicular LED lights. Therefore, LEDs with fixed luminance that is optimal for a wide range of ambient light illuminance can be used to obtain the lowest BER. However, for optimal performance of the VOCC system, the luminance of an LED should be optimized at every level of ambient light. This suggests that LEDs used for VOCC systems need to be designed with a dimming capability and the optimal luminance of LEDs corresponding to each level of ambient light needs to be investigated further. Besides, the bit detection accuracy is also dependent from the size of LED and LED panel, the shape of LED and LED panel, and many parameters related to camera and other components of VOCC system. The impacts of these parameters will be thoroughly investigated in our future work.

V. CONCLUSION
This paper proposed a novel LED bit detection algorithm for vehicle optical camera communication systems. In existing LED bit detection algorithms, the On and Off statuses of the LED are only determined by the greyscale, which can be a misleading feature owing to many error sources. In the proposed algorithm, three different features of an LED namely AGR, GRI, and NGR are used to determine its status. Two features AGR and GRI individually have much better discriminability of LED status compared to greyscale, thus providing a high bit detection accuracy. Moreover, as the three features differentiate LED statuses under different perspectives, their combination using FLDA results in an even greater level of bit detection accuracy. To provide a fair evaluation of the performance of the proposed algorithm, highly realistic simulations are conducted and the impacts of system parameters on the BER are examined. The results show that the BER of the proposed algorithm is much lower than that of existing algorithms. Importantly, the simulations reveal that optimal BERs can be achieved by choosing the optimal levels of LED luminance corresponding to each level of ambient light illuminance. This suggests that VOCC systems with dimmable LEDs and the luminance optimization of LEDs require further research in the future.