## 4 Simulations
### Perspective Distortion  
Although the above results are based on the assumption of perfect alignment between the camera and display, in a real-life situation, a camera may not always be aligned frontally with the display screen, and there may be instances of distortion due to the tilting or rotation of the camera relative to the display. This type of distortion degrades DFC performance and is modeled as a perspective distortion [23]. Perspective distortion causes straight lines in the scene to appear curved or skewed in the resulting image and objects farther away from the camera appear to be smaller. In the simulations, the perspective transformation matrix is computed using the geometric transformation of a set of matched control points. A projective transformation can be represented by a \(3\times 3\) matrix known as a homography matrix. Given a point in homogeneous coordinates, which is represented as a \(3\times 1\) column vector \([x,y,w]^{T}\), a projective transformation can be represented as  
\[[x^{\prime},y^{\prime},w^{\prime}]^{T}=\boldsymbol{\mathcal{H}}[x,y,w]^{T}, \tag{26}\]  
Figure 6: Comparison of PSNR performance of the proposed iterative pilot-based 2D-DFC scheme with conventional 2D-DFC scheme [19].  
where \([x^{\prime},y^{\prime},w^{\prime}]^{T}\) is the transformed point in homogeneous coordinates, and \(\mathbf{\mathcal{H}}\) is the homography matrix. The homography matrix \(\mathbf{\mathcal{H}}\) can be computed from a set of corresponding points in the two images using a method known as direct linear transformation (DLT). Given \(n\) corresponding points, the homography matrix can be computed by solving a system of linear equations of the form:  
\[\mathbf{\mathcal{A}}\times\mathbf{h}=0, \tag{27}\]  
where \(\mathbf{\mathcal{A}}\) is a 2\(n\)\(\times\) 9 matrix, \(\mathbf{h}\) is a 9 \(\times\) 1 column vector containing the elements of \(\mathbf{\mathcal{H}}\) in row-major order, and the symbol \"\(\times\)\" denotes the vector cross-product. When the homography matrix is computed, it can be used to transform the transmitted images.  
At the camera receiver, the boundaries of the electronic display should be accurately detected before data retrieval. Harris corner detection and Hough transform can be used to recognize the borders of the display for precise image alignment. The distorted image can then be resized to its original size by obtaining missing pixels using interpolation. The image is then restored using a homography estimation.  
Figure 7 illustrates the effects of perspective distortion on an image, and the corresponding recovery using our proposed scheme. As shown in Figure 7a, the image was subjected to skewing and rotation, particularly at the edges. Figure 7b shows the corrected image, which is more accurately proportioned and shaped. Figure 8 presents the performance of the proposed scheme on an image affected by perspective distortion, which was subsequently corrected. Figure 8a shows the symbol error rate (SER), which shows an improvement in performance with an increasing number of iterations using virtual pilots. Our proposed scheme approaches the ideal 2D-DFC scheme despite the poor SER owing to substantial distortion in the image. Figure 8b shows the achievable data rate of the scheme, which is lower than that of the perfect alignment case. Nevertheless, our proposed scheme outperformed the conventional 2D-DFC scheme and achieved almost two-fold higher data rates even in the presence of perspective distortion.  
Figure 8: Performance of the proposed scheme in the case of perspective distortion. (**a**) Symbol error rate. (**b**) Achievable data rate.  
Figure 7: Distortion correction of received image affected by perspective distortion. (**a**) Perspective distortion. (**b**) Perspective correction.