Intensity gradient based edge detection for pixelated communication systems

Pixelated optical communication systems transmit data using a series of encoded pixelated images. The decoding of these pixelated images is important for reliable data communication. This study proposes a novel intensity gradient-based edge detection (IGED) method for the received pixelated images. In the first stage of the proposed edge detection algorithm, the intensity difference of neighbouring pixels is calculated in the horizontal or vertical direction depending on the presence of a horizontal or vertical edge. In the second stage, the false edge pixels whose intensity values are less than the threshold are removed. Next, slopes are calculated between the consecutive edge pixels and the appropriate lines are found considering the slopes that have almost the same value. The new IGED method performs edge detection without requiring any anchor pixel blocks. This study also provides a description of a misalignment correction algorithm suitable for pixelated images. Next, the effectiveness of the proposed IGED method is tested through an experimental demonstration. It is shown that the IGED method can properly detect the edges even for pixelated images affected by rotational misalignment. For a given transmitter resolution, the proposed method provides better data rates than the existing methods.


Introduction
Day by day, the cameras and light-emitting devices have become popular in our indoor and outdoor environment. Integrated cameras are widespread on phones, laptops, e-readers, music-players and many handheld games. Light-emitting displays, signage and monitors are used in the form of electronic billboards, computer monitors, information kiosks, mobile displays and a smaller dimension of hand-held devices. The widespread cameras and displays have created an exciting and novel opportunity in our society to build camera-based communication system [1][2][3][4][5]. In such a system, a sequence of images encoded with data is transferred between liquid crystal display (LCD) and a camera receiver [5][6][7][8][9][10][11][12]. Instead of LCD panel, an array of light-emitting diodes (LEDs) can also be used as pixelated transmitters. Similarly, an imaging lens along with an array of photodiodes (PDs) can be used instead of a camera. This sort of data transfer system is known as optical camera communication or pixelated optical wireless communication (OWC). The data transmission rate for pixelated OWC depends on the number of image frames per second (FPS) and the number of pixels per image frame.
A pixelated system can be impaired by misalignment. This is because it is not possible to align the transmitter and the receiver perfectly in space in a practical scenario. In the case of linear misalignment, the misalignment effect takes place linearly either in horizontal or vertical direction [13]. On the other hand, for rotational misalignment, the received image is in angle with respect to the transmitted image. Misalignment distorts the received images and received data, and also makes accurate edge detection more complicated.
A number of research works on edge detection of images are described in the field of image processing. For example, Hough transform is the frequently used geometric correction technique of the quick response (QR) code image. Hough transform suitably detects the line of QR code image when there is no distortion or interference of the other lines; otherwise it fails to detect the appropriate lines [14]. Hough transform is unusable for distorted images, but is effective when image rotation is the only distortion. The problem of the misaligned QR code images can be overcome by using Harris corner detection with convex hull algorithm [14].
Some research works focus on the automatic detection of face sketches [26,27] in the context of forensic applications. For example, the authors in [26,27] use edge features of face sketches and photos and then compare these features using the Smith-Waterman algorithm for local alignments. In these cases, the edge feature is represented in polar coordinates [26,27]. Accurately finding the object edges in the presence of pixel noise is a challenge of automated edge detection methods for a gradient sketch model [28]. In [28], authors perceive brightness and neighbourhood similarity to determine the object edges. This method provides robustness with respect to Sobel, Kirsch, and Prewitt edge detection methods [28]. Single edge detection methods have poor gradient change causing problems while detecting edges [29]. In [29], authors combine local and global edge detection to extract edges. The global edge detection uses Canny operator, which detects all edges. The global edge contains false edges. The local edge detection method is based on k-average method. Both methods are combined to remove false edges [29]. The performance of the Canny operator decreases with the increase of image datasets. To improve edge detection, the authors in [30] use parallel implementation of Otsu-optimised Canny operator. The Otsu algorithm is used to calculate the dual-threshold and to optimise the Canny operator [30].
In [31], the edge component is calculated based on the direction of strong edges. The authors in [31] use Riemann-Liouville fractional differential operator to enhance the feature and contrast of images. It is reported in [32] that edge detection is difficult with precision and low complexity. So, in order to improve the detection complexity authors in [32] take the benefits of Faber Schauder wavelet (FSW) and Otsu method to detect the edges in multi-scale with low complexity. The wavelet coefficients are located on edge points with only arithmetic operator. At first a bilateral filter is used to smoothen the image. Then FSW coefficients are calculated based on Otsu threshold. Finally, predictive edge linking algorithm is used to link up the edge pixels to get the image edge [32]. To improve the edge detection for blurry and low signal to noise ratio images, authors of [33] use adaptive Canny edge detection algorithm. In this case, first image enhancement is done by using contrast-limited adaptive histogram equalisation algorithm. Next the images are smoothed by using morphological filters. Otsu algorithm is used to calculate the high and low threshold for Canny operator which improves the performance of Canny operator [33]. In the work [34], image corner detection is based on adaptive threshold of a local area and a mask with filled circle and outer ring. At first, the inner filled circle is used as a function to filter corner regions. Then, inner and outer rings are used to detect corner candidates. Finally, the false corners, noise and salient pixels are determined and false corners are removed [34]. Authors in [35] use resistant to affine transformation and monotonic intensity change (RATMIC) descriptor to remove the unwanted smoothing of the output of the Canny detector. The Harris corner detector is applied to catch line segmented regions. After that, the RATMIC descriptor is used to get the binary image from the region of interest (ROI). Finally, the straight line is detected using eigenvalue analysis [35].
To separate the desired pixelated data from the background, it is needed to detect the desired area of the data. The existing methods of corner detection are not sufficient, because an image contains a lot of corners. The conventional line detection method fails to detect the desired four lines, as an image has many lines with various lengths. The most used 'Sobel', 'Canny', 'Prewitt' edge detection methods fail to give the appropriate results. Therefore, pixel difference-based edge detection is proposed in this paper. The two main contributions of this paper are: (i) A novel edge detection method termed as intensity gradientbased edge detection (IGED) is proposed for pixelated OWC. This method exploits the specific pixel intensity patterns of borders to detect the image edges. (ii) The proposed IGED method is experimentally demonstrated for a pixelated OWC system. The edge detection is carried out in the presence of rotational misalignment of received pixelated images. This new IGED method is compared with the existing edge detection techniques for a number of pixelated images.
Hence the novelty of the paper is the new edge detection method termed as IGED suitable for pixelated images. The algorithm of this new IGED technique is described in this work. Furthermore, a practical experiment is carried out to verify the feasibility of this IGED method in a prototype pixelated system. In order to remove any rotational misalignment, the algorithm of a misalignment correction technique is discussed in theory and then applied in the experiment.
The rest of the paper is organised as follows. Section 2 presents the fundamentals of a pixelated communication system. Section 3 presents the existing edge detection methods, while the proposed method is described in Section 4. The misalignment correction method used in this work is discussed in Section 5. The practical implementation and the results on different methods are reported in Section 6 followed by the concluding remarks in Section 7.

Description of pixelated systems
Apart from pixelated OWC, there are multiple forms of OWC systems. For example, visible light communication (VLC) is a type of OWC proposed for micro-cell and attocell as part of the future 5G networks. Light fidelity (LiFi) is a fully networked bidirectional type of VLC. Both VLC and LiFi have the properties of no electromagnetic interference, signal confinement, beamforming facility with optics, and due to line-of-sight facility [36][37][38][39].
The pixelated communication differs from VLC in the type of receiver used. Pixelated communication uses a camera which has a two-dimensional (2D) array of PDs in order to collect and then demodulate data carrying optical signal. Pixelated communication systems using screen transmitters ensure that the light intensity changes are imperceptible to the human eye that is flicker free. The pixelated OWC is based on the concept of multiple-input multipleoutput (MIMO). Fig. 1 presents a basic pixelated OWC system. It can be seen from Fig. 1 that the spatial light modulators for example LEDs are used as transmitters, while imaging lens and optical intensity receivers are used as receivers. The transmitter has an array of transmitting elements forming n × n square matrix and generates the positive-valued pulses with width (bit duration) of T b . The receiver is made up of a camera, an image processing unit and a decoder. Pixelated OWC has the potential to be used for augmented reality. Pixelated communication allows for a scalable data rate. Some of the pixelated systems use spatial orthogonal frequency division multiplexing (OFDM) [10][11][12][13]. These schemes can obtain data rates as high as megabits per second. Pixelated communication can be used at outdoor with high frame rate and RoI signalling techniques [36][37][38][39].
A pixelated communication [10][11][12][13] consists of a camera which is a combination of a lens and an image sensor. In comparison with the PD, this camera ensures the spatial separation of light from its existent lens. The camera demodulates multiple light sources such as LEDs that are spatially separated. Pixelated communication has only recently been adopted in the ongoing OWC standardisation at TG7m [36][37][38][39]. Pixelated communication specification desires to support compatibility without modifying the cameras' hardware, and thus the design of pixelated communication must take into consideration the characteristics of cameras and the constraints imposed by these cameras. Since common cameras usually have low frame rates with acceptable image resolution limiting the maximum capacity of the pixelated communication channel. Therefore, the design of pixelated communication system is a challenging task [36][37][38][39].
The appropriate modulation for pixelated communication will depend on the transmitting light sources, light exposure technique and receiving imaging sensors [36][37][38][39]. Cameras must be classified by the effects of their characteristics on the communication performance since the choice of receiving cameras affect the selection of signal formats transmitted by the LED sources. An important feature of camera is the frame rate. The sampling frequency of a receiving camera determines how much data can be demodulated in accordance with the Nyquist sampling theory. The frame rates of cameras can vary from as low as 30 FPS to thousands of FPS. The camera shutter mechanism is a determining factor for the exposure of the image pixels. The cameras can be of global or rolling shutter. Global shutter cameras expose all image pixels simultaneously. Such cameras require very fast frame rates to detect the change of light intensity over consecutive images frames. On the other hand, rolling shutter cameras sequentially expose pixel rows to light, and thus such cameras must sample quick enough to detect the changing light intensity that is modulated in the rolling image [36][37][38][39].
Two major challenges of pixelated communication are the low signal detection in mobile scenarios and the computational complexity of high-speed cameras [10][11][12][13][36][37][38][39]. The pixelated communication schemes with high frame rate cameras oversample the signal and thus demodulating and detecting the optical signal become difficult and complex. The problem increases in mobile situations. For the case where the RoI representing the area of the transmitter is detectable and traceable, high frame rate demodulation becomes possible. In contrast to the rolling-shutter cameras, the global-shutter camera is recommended for the case of high data rate applications [36][37][38][39].

Existing edge detection techniques
This section describes a number of existing edge detection techniques.

QR code
This QR code method combines corner detection and convex hull algorithm [36]. An important consideration is that uneven light in the environment causes the brightness of the QR code images to be uneven. Thus, it becomes difficult to obtain a virtual image display, and hence the QR code images require binarisation of which getting the threshold is most important. Note that the Sauvola method uses integral images for fast computation of the threshold function [14].
With this consideration, mathematical morphology and local threshold are used to obtain binarisation of the collected QR-coded image with uneven light. To compute the binary equivalent of the QR code image, the Sauvola adaptive threshold can be considered as follows [14]: The default values of R and k are 128 and 0.5, respectively [14]. Next, Harris corner detection is performed and then the convex hull algorithm is applied. The outline of the QR code is then extracted and the dots on it are found. Finally, the distorted image is recovered by perspective collineation [14].

Aesthetic QR code
Aesthetic QR code is generated from a standard QR code by adding logo images, colour, and other features attractive to the human eye [40,41]. This is done by using certain rules to modify the standard black and white square modules of a QR code. The encoding method of Reed Solomon codes is changed to generate aesthetic QR codes. Such aesthetic QR codes can still be scanned by standard QR code reader with the help of error correction techniques [40,41].

Random checkboard localisation
The electronics display detection is performed in two steps [42]. First, the localisation of checkerboard on the image is found using the concept of line and corner detection. Second, each block is detected and black and white levels are assigned. To detect the checkerboard, four known intensity anchor blocks at the four corners are fixed. Then binary image dilating is used to remove the noise. After that Hough transformation is used to detect the line segments in the image [42]. The orientations of line segment are used to find the vertical and horizontal lines. Based on the line, the corner of each block is detected. Harris corner detection technique is used to select the good corners of the image. With the help of four corner anchor blocks and two parameters (i.e. the number of blocks in each row and columns), each block location can be identified [42].

Binary large object-based approach
For QR code detection in uncontrolled environments, the geometrical features of QR code are recognised using a binary large object (BLOB)-based algorithm [43]. This technique can detect QR codes with an accuracy of 80-100% in the presence of strong blurring, significant non-uniform illumination, considerable symbol deformations, and noising. In this BLOBs method, only three finding patterns are processed to speed up discovering and alignment of QR codes. This reduces the complexity of detection procedure and provides great accuracy in identifying multiple QR symbols in images captured in uncontrolled environments. Furthermore, the white margin (four-module wide) is not required in this approach [43].

Multiple OFDM symbols
In multiple OFDM symbols method, the border areas are used to extract and detect the symbol code [8]. To determine the rotation, this method uses four rotation tracking prefix codes at all corners. The transmitted symbols contain clock cells which are surrounded by the code area. The clock cells represent the code block size and are used to help the detector in determining the proper sampling rate in the presence of noise. This method also contains cyclic prefix (CP) around the data. The length of CP can be about 1/8 to 1/32 of an OFDM symbol [8].

Description of IGED method
The algorithms of IGED method can be written as follows: Step 1: Start.
Step 2: Capture the image I.
Step 3: Remove the noise.
Step 4: Find the pixel gradient in the horizontal direction, I h_diff .
Step 5: Find the pixel gradient in the vertical direction, I v_diff .
Step 6: Find the maximum of each pixel position I diff by finding the maximum of I h_diff and I v_diff .
Step 7: Find edges based on spatial/pixel difference. This is done by comparing I diff with a threshold. Remove the false edge pixels having the intensity values less than the threshold.
Step 8: Find the four border lines of the image. For this calculate the slope between two consecutive edge pixels. Next find the appropriate border line considering the pixel positions where the slopes have almost the same value.
Step 9: Determine the image corner point based on the border lines.
Step 10: End The above-mentioned edge detection and misalignment correction can be described in the following.

Capturing of images
In a pixelated communication system, the captured image 'I' contains both the desired image I d and the background I b of the display to avoid data loss. The camera's lens may be parallel with the display (where the pixelated data is shown) or not. In addition, it may create some angle in 2D spaces. The image I d only contains the data. Therefore, it is essential to separate the desired data from the background data and correct its alignment. This is the main challenge of this work. In this work, a uniform background is assumed.

Noise removal
An image may be affected by different types of noise such as Gaussian noise, pepper noise, salt noise, etc. The Gaussian mask can be used to remove the Gaussian noise. If the total image is convolved in pixel by pixel using Gaussian mask, the unexpected intensity level can be reduced.

Finding edges
The edges of the image are determined by considering edges in both the horizontal and vertical direction and finding the maximum one. At first, consider the pixel gradient in the horizontal direction, I h_diff . For this the captured image having dimension of n, m is vertically divided into two parts I h1 (x i , y j ) and I h2 (x k , y l ) where J. Eng x i = x 1 , x 2 , x 3 , …x n , y j = y 1 , y 2 , y 3 …y m/2 , x k = x 1 , x 2 , x 3 …x n and y l = y m/2 + 1 , y m/2 + 2 , …y m . Now, the pixel differences from present pixel to the previous pixel for part I h1 (x i , y j ) is given by In this case, (x i , y j ) and (x i , y j − 1 ) are indices of two immediate neighbouring pixels. Similarly, the pixel differences from present pixel to the subsequent pixel for part I h2 (x k , y l ) is as follows: In this case, (x k , y l ) and (x k , y l − 1 ) are indices of two immediate neighbouring pixels. In order to get pixel gradient/difference in the horizontal direction, the terms I h1 (x i , y j ) and I h2 (x k , y l ) are combined by horizontal concatenation as follows: The value of I h_diff in (4) can be obtained using (2) and (3). Now consider the pixel gradient in the vertical direction, I v_diff . Next, the captured image is horizontally divided into two parts I v1 (x i , y j ) and I v2 (x k , y l ) where x i = x 1 , x 2 , x 3 …x n/2 , y j = y 1 , y 2 , y 3 …y m , x k = x n/2 + 1 , x n/2 + 2 , …x n and y l = y 1 , y 2 , y 3 …y m . The pixel differences from present pixel to the upper pixel for part I v1 (x i , y j ) is Similarly, the pixel differences from present pixel to lower pixel for the part I v2 (x k , y l ) is In order to get pixel gradient/difference in the vertical direction, the terms I v1 (x i , y j ) and I v2 (x k , y l ) are combined by vertical concatenation as follows The term I v_diff in (7) can be obtained using (5) and (6). The maximum value in each pixel position using (4) and (7) can be obtained as In this case, max is the maximum operator. Under the above considerations, the edge (I edge ) of the captured image can be found by putting a threshold on I diff . The threshold is computed based on the global thresholding method, which is adjusted depending on the presence of a number of high-intensity pixels.
where a is constant depending on the number of high-intensity gradient pixels, the values of a are limited within 0 to 10 for an 8bit intensity level starting from 0 to 255. However, a is higher when less high-intensity gradient pixels are present and a is lower when more high-intensity gradient pixels are present. This gives the appropriate separation between the desired data and background data.

Finding border line
To identify the border line of the desired data I d , the I edge portion is scanned to get some appropriate edge pixels. For this the top border line of I d needs to be identified. Scanning is then performed for I edge for every row and column from top to bottom. If a nonzero pixel is found in each column then its position can be stored and scanning the column can be stopped. This will be done from the first column to the last column. So, some pixels are obtained that are situated at the top edge of desired data image. Now the slope between two stored pixels is calculated for all arrangements. Ideally, on a border line, the slopes of the edge pixels should be the same. In practice, most of the slopes on the border line will be the same and only a few slopes will have different values. So, starting from the edge pixel on the first column, a line segment has to be formed with the adjacent edge pixels. More edge pixels will be added to extend the line segment as long as the slope does not change significantly. The positions of completely different slopes have to be ignored. In this way, by taking into consideration the approximately same valued slopes, the position of the border lines can be determined. The top border line pixels can thus be found from the position of the slopes whose values are almost equal.
Using the similar approach, the bottom line pixels can be found by scanning each row and column from bottom to top of the image.
Using the similar approach, the bottom, left and right border lines can be found. To get the left and right border pixels, scanning has to be performed for each column and row from left to right and right to left, respectively, scanning has to be stopped for each row when a non-zero pixel is obtained. The left and right border lines can be found from those pixels.

Finding corner points
The corner points can be determined from the border lines. If a line passes through two points then the equation of a line is x − x n x n − x n − 1 = y − y n y n − y n − 1 (10) In (10), the line is passed through two points (x n , y n ) and (x n − 1 , y n − 1 ). Therefore, there are four lines: top, bottom, left and right passing through the top, bottom, left and right edge pixels, respectively. These lines can be expressed in the following general form. (11) where i = 1, 2, 3, 4. The intersection point between the top line with the left and right lines indicates the top-left corner (x t_l , y t_l ) and top-right corner (x t_r , y t_r ) points. Similarly, the bottom-left (x b_l , y b_l ) and bottom-right (x b_r , y b_r ) corner points are found from the intersection between bottom line with left and right lines.

Misalignment correction
The algorithms of misalignment correction can be written as follows: Step 1: Start.
Step 2: Detect the shape of the image and the orientation.
Step 3: If shape square or rectangle, extract the desired portion from the captured image.
Go to Step 7. Else find the largest border line and set it as the reference line. In addition, find the small and large lines beside the reference line.
Step 4: Using the reference line, create an image whose left and right border edges are parallel to each other.
Step 5: Modify the image in Step 4 to make the top and bottom edge lines as parallel to each other.
Step 6: Extract the desired portion from the captured image.
Step 7: End If the camera lens is not parallel and misaligned with respect to the display, then the alignment needs to be corrected. In pixelated OWC, the dimension of the desired data image I d on the captured image may be different, for example: (i) Square or rectangle or rhombic.
(iii) Trapezium (no parallel sides). Fig. 2 shows three differently shaped received images. The illustrations in Fig. 2 are for a square, for a rectangle and for a rhombic image. Now the pixel difference in each line is calculated to categorise the image. The lengths of top, bottom, left and right lines are represented as the pixel difference as d t , d b , d l and d r where In addition, the slopes of the four lines m 1 , m 2 , m 3 and m 4 are found as the slopes of top, bottom, left and right lines, respectively. If all pixel differences are the same and the slopes of the opponent arms of I d are the same, it is a square. If two opponent arms have the same pixel difference and the same slope, it is rectangle or rhombic. Now the captured image is scanned inside the four lines and each pixel is separated accordingly to create the 2D desired data image I d .
If one opposite line pair is parallel and the other two are not parallel, then the desired data image is in trapezoidal form. This trapezoidal form is transformed into a rectangular image format in the following method. It can be seen that within the two parallel lines of a trapezoid, there are many parallel lines. Among these group of parallel lines, the smallest and the largest ones are found and one is set as the reference. Next, each line is scanned within the image and the length of each line is converted to as the length of the reference. After that the desired image can be found in a square or a rectangular form. Fig. 3 shows the trapeziuml-shaped desired image to rectangular shape image conversion. In this case, the smaller of the two parallel lines is considered as the reference line for the trapezoid. As observed from Fig. 3, each line between the parallel lines of the trapezoid is scanned to convert to the length of the reference line.
If the length of every line is different, the slope is also different, and the desired data image is in the form of trapezium. This trapezium-shaped image is transformed into a rectangular image format in the following method. First of all, the largest line of the trapezium is set as the reference. There are two lines beside the reference, one is larger denoted as l large , and the other is smaller denoted as l small . Next, a line l p is drawn parallel with the reference. This l p line is passed through the corner point of l small line, but intersects l large line in a particular point (x k , y k ). Next calculation is done to find the length between (x k , y k ) and intersecting point of the reference and l large . This calculated length is used to draw the left arm of the trapezium. In this way, the desired image is converted into a trapezoidal form. Next, the trapezoid is converted to rectangular format as described in Fig. 3. Fig. 4 shows the trapezium-shaped desired image to rectangular shape image conversion. It can be seen from Fig. 4 that the trapezium-shaped image is first transformed to a trapezoid format which is then transformed into a rectangle form.

Practical demonstration
This section discusses a practical demonstration of a pixelated system impaired by rotational misalignment. A schematic diagram of the experimentation is illustrated in Fig. 5. In this case, a smartphone captures the transmitted image on a laptop, and the image is transferred to another laptop via USB for post-processing. Moreover, Fig. 6 shows the image capturing of the experiment. In this case, a smartphone is using its camera to capture the datacarrying pixelated image displayed on a laptop.
The block diagram of the transmitter and receiver parts used for the experiment is presented in Fig. 7. It can be seen from Fig. 7 that the binary data is modulated in the electrical domain before image creating at the transmitter and the captured image is processed at the receiver for border detection and misalignment correction. In the experiment, the LCD panel of a laptop with a resolution of 1366 × 768 pixels was considered as transmitter array. A random binary data of 16 × 16 matrix was generated in the transmitter laptop, which was then used to create a transmitting image with 16 × 16 cells. There were several processes in-between data generation and image formation performed using MATLAB tool. The data were mapped to quadrature amplitude modulation (QAM) [3,10] symbols. The concept of Hermitian symmetry [3,10] was also used to ensure there was no complex element in the spatial OFDM signal. To generate spatial OFDM signal, a 2D inverse fast Fourier transform (IFFT) [3,10] was applied on the 4-QAM symbols. The 2D IFFT transforms the spatial frequency domain signal to 2D spatial domain. The output of 2D IFFT was real and bipolar. An appropriate DC bias [3,10] was added on the bipolar signal to remove the negative elements. The obtained positive valued real signal was suitable for conversion to optical domain forming the image. In this way, the data were displayed on the laptop screen in the form of pixelated images. The intensity of the pixelated image blocks had 'no intensity' marked as black or 'full intensity' marked as white. The white cells represented data value of 255 intensity, whereas the black cell represented a data value of 0 and other cells represented the data value within 0-255. The dimensions of the generated images were depending on the device screen size.
For capturing the image, the Walton GM mini Pro of 5 inch display was used, having 720 × 1280 pixels (resolution) with 30 FPS speed. After capturing the image, the data were transferred to the laptop for misalignment correction using MATLAB. The algorithm of misalignment correction error discussed in Section 5 was applied. The laptops used for the experiment had specifications of Intel core i3-3110M, 2.4 GHz processor, RAM 4 GB.
The proposed IGED edge detection method is tested on different types of images having rotational misalignment errors. Pixelated images with three different pixel blocks are considered. Fig. 8 illustrates the three types of pixelated images having 16 × 16, 32 × 32 and 64 × 64 pixel blocks. The effect of defocus blur on these three types of image edges are shown in Fig. 9. Moreover, Fig. 9 considers the defocus blur with different magnitude of defocusing that is having point spread function of different Gaussian distributions. In Fig. 9, the images denoted as (a), (b), (c) and (d) represent the cases for no blur, 3 × 3, 5 × 5 and 10 × 10 Gaussian blurs, respectively. It can be seen that with the increase in the blur, the number of edges decreases. However, the width of the edges increases due to the gradient decrease of pixel intensity. The experimental results of the captured image and the misalignment corrected images are shown in Fig. 10. The images are of 64 × 64 pixel blocks. Fig. 10a represents the mobile-captured grey-scale images, Fig. 10b represents the proposed edge-detected images and Fig. 10c represents the misalignment-corrected images. From Fig. 10 it can be seen that the proposed IGED method detects the edges correctly and the misalignment correction method satisfactorily corrects the misalignment error.   In the experiment, the proposed system was tested by capturing hundreds of images for each frame size. For example, for a 16 by 16 frame size, 140 images were captured using appropriate focusing and keeping the rotational misalignment and artificial room lighting within a limit. This new IGED method successfully detected the edges of all the images indicating accuracy of 100%.
Next, the proposed IGED system is compared with the existing QR code, aesthetic code, random checkerboard localisation, BLOB and multiple OFDM symbols methods. The existing methods use the medium to large pixel blocks of predefined intensity termed as anchor blocks at each corner of the transmitted image. The use of the anchor blocks reduces the effective transmitter display pixels. This results in reduction in data transmission rate for pixelated OWC. Since the proposed IGED method does not need the overhead anchor blocks, it can use every pixel to transmit data resulting in increased utilisation efficiency. This results in high transmission rate in the context of pixelated OWC. It can be noted that the information transmission rate for a pixelated system is a function of the frame rate, the number of pixels per frame, and the number of bits per pixel. For instance, consider a pixelated transmitter with 15 FPS with 64 × 64 pixels per frame and 4-QAM modulation. This means the overall data transmission rate is 122.88 kbps, as 4-QAM ensures 2 bits per symbol or pixel. A QR code method with version 20, has a loss of 5%. This means data transmission using the IGED method will be 122.88 kbps, whereas that of QR code will be only 116.74 kbps. Table 1 summarises the comparative study of the proposed IGED method with the existing methods. These existing methods are applicable to large or medium block size images. The proposed IGED method is effective for all resolution images. The area loss in QR code and aesthetic code depends on the version number. The loss in multiple OFDM symbols depends on the length of CP mentioned in Section 3.5. For example, a CP length of 1/8 of OFDM symbol indicates a loss of ∼12.5%.

Conclusion
In this paper, a new edge detection method termed as IGED is proposed for pixelated images in the context of pixelated OWC. This method detects image edges by finding the intensity gradient in the horizontal and vertical direction and then by comparing the pixel gradient with a preset threshold. Next, the image border lines are determined by considering the slopes of consecutive edge pixels. The intersection of the border lines indicates the four corner points of the wanted images. The algorithm of the IGED method is discussed and an experiment is designed to show the effectiveness of this scheme. Experimental results indicate that the IGED method is effective for pixelated systems. Even the edges of images affected by rotational misalignment can be detected by IGED scheme. Comparative results are presented for IGED scheme with the existing QR code, aesthetic code random checkerboard localisation, BLOB and multiple OFDM symbols methods. It can be seen that unlike the existing methods, the IGED algorithm detects the original pixelated images without using overhead anchor blocks. Therefore, the IGED scheme is suitable for ensuring high data rate transmission of pixelated OWC. In future, the reliability of this method will be tested in uncontrolled environment that is in the presence of strong defocusing, severe misalignment and excessive ambient lighting. Table 1 Comparison of different types of misalignment correction methods Feature