# A Generic Framework for Enhancing Autonomous Driving Accuracy through Multimodal Data Fusion
## 4 Proposed Study
### Proposed Feature Extraction Models
#### 4.2.1 Proposed Edge Detection Method  
The study proposes an enhanced [PERSON] edge detection method. [PERSON]'s approach uses the below-listed matrices to detect the horizontal and vertical edges of an image. \[T_{x}= \begin{bmatrix}-1&0&1\\ -2&0&2\\ -1&0&1\end{bmatrix} T_{y}= \begin{bmatrix}-1&-2&-1\\ 0&0&0\\ 1&2&1\end{bmatrix} \]  
However [PERSON]'s method has a major drawback in that, aside from horizontal and vertical directions, they never traverse the pixels that represent the edges from other directions [39]. Hence, for images with good texture, the accuracy of edge detection using [PERSON]'s method is not good. Hence, this research introduces new templates for edge detection that cover all dimensions of image pixels that are represented as two-dimensional matrices. It is a \(5\times 5\) matrix represented as four templates, namely \(T_{x}\), \(T_{y}\), \(T_{l,j}\) and \(T_{i-1,j-1}\), denoting vertical, horizontal, and diagonal wise horizontal and vertical representations of pixel weights, respectively. The weight of each template position is ascertained by its distance from the center as well as its directions. The weight of the equidistant points is the same. The following are the derived templates:  
\[T_{x}= \begin{bmatrix}2&3&0&-3&2\\ 3&4&0&-4&-3\\ 6&6&0&-6&6\\ 3&4&0&-4&-3\\ 2&3&0&-3&2\end{bmatrix} T_{y}= \begin{bmatrix}2&3&6&3&2\\ 3&4&6&4&3\\ 0&0&0&0&0\\ -3&-4&0&-4&-3\\ -2&-3&-6&-3&-2\end{bmatrix} \]  
\[T_{i,j}= \begin{bmatrix}0&-2&-3&-2&-6\\ 2&0&-4&-6&-2\\ 3&4&0&-4&-3\\ 2&6&4&0&-2\\ 6&2&3&2&0\end{bmatrix} T_{(i-1,j-1)}= \begin{bmatrix}-6&-2&-3&-2&0\\ 2&-6&-4&0&2\\ -3&-4&0&4&3\\ -2&0&4&6&2\\ 0&2&3&2&6\end{bmatrix} \]  
In the proposed approach, the template that produces the largest value for the input image is selected for further processing. The pixel value that produces the maximum threshold value is considered an edge. Generally, there are three ways of threshold estimation: (i) overall threshold, (ii) local threshold, and (iii) dynamic threshold estimation techniques. This study follows the overall threshold estimation method. In the proposed approach,  
Figure 5: Proposed Framework. gene-mutation-based techniques are used to detect an edge, and hence an overall threshold estimation approach is followed in this research. In the first stage, the input image is either in 2D \(f(x,y)\) (or) 3D \(f(x,y,z)\) and is represented in the gray range, say \(0,1,\ldots L-1\). If the input images are in a 2D format then the study uses the same transformation mechanism followed in the proposed hybrid image fusion model to convert 2D to 3D images, else the study follows the following steps to detect the presence of an edge in the input image. Then, before initiating the edge detection, the entire image is divided into two categories of thresholds, namely \(t:C_{0}=(0,1\ldots t)\) and \(C_{1}=(t+1,t+2\ldots L-1)\). For a gray image of (N) pixels, the probability, \(P_{i}\), of each gray level in a gray image is calculated using Equation (1)  
\[P_{i}=\frac{n_{i}}{N},i=0,1,2\ldots L-1 \tag{1}\]  
Now the square error between the two classes is calculated using the below equation. \[\gamma^{2}=\omega_{0}\times\omega_{1}\times((\mu_{0}-\mu 1)^{2}) \tag{2}\]  
where (\(\omega_{0}=\sum_{0}^{l-1}P_{i}\), \(\omega_{1}=\sum_{t+1}^{L-1}1-\omega_{0}\mu_{0}=\sum_{0}^{l-1}P_{i}/\omega_{0}\) and \(\mu_{1}=\sum_{t+1}^{L-1}P_{i}/\omega_{0}\)). \(\omega_{0}\) denotes the pixels whose gray value is less than the threshold value, \(\omega_{1}\) indicates the pixels whose gray value is greater than the threshold value, \(\mu_{0}\) represents the mean gray value of pixels whose image gray value is less than the threshold value, and \(\mu_{1}\) denotes the average gray values of the pixels whose image gray values are greater than the threshold value. The image gray values must be substituted in the four templates to estimate the best template that maximizes Equation (2). Any pixel value that has a value greater than or equal to the maximum threshold value is considered an edge.