# Efficient Filtering for Edge Extraction under Perspective Effect
## 4 Implementation  
In traditional multi-scale strategies, only a few scales are taken (e.g., three scales). In this case, the whole image is convolved with these three kernels. In this paper, the response at each position is obtained by performing an arbitrary kernel. If we design a specific kernel for each position, the computational cost will be prohibitively large. Efforts have been made to alleviate such a problem. In one previous study, steerable filters [19] have been proposed, so that, the response of a kernel with arbitrary orientation can be obtained using the linear combination of several kernels with fixed orientation. However, in this method, only symmetry Gaussian kernels are suitable. Another previous study presented the LDA method [20], in which all the possible kernels for different scales and different orientations are collected and then several kernels are trained by using LDA from all these  
Figure 8: Workflow of the proposed speedup orientation and scale tuned difference of boxes (osDoB). possible kernels. We note that, if the possible kernels vary in both orientation and scale, the number of representative kernels is very large and limits the reconstruction error [20]. This prevents the idea from being realized in real time. If the aspect ratio of the possible kernels is not 1, the number would be higher [33]. In this paper, we propose a novel, fast-acting algorithm for this task. The algorithm can be realized in real time. In this project, we used DoB to detect local features. In fact, DoB is the optimal approximation of a Gaussian kernel. Given the basic shape of the DoB (e.g., the order, as shown in Figure 9) kernel \(k_{p}\), the DoB with different scale \(s\), aspect ratio \(\lambda\), and orientation \(\gamma\) is defined as a spanned space, as follows:  
\[\{k_{p}\}=k_{span\{s,\lambda,\gamma\}}. \tag{28}\]  
Integration maps [34; 35] have been proposed as a method of computing the responses of Harr-like kernels to a natural image. For any rectangle R in an image, the sum of the pixels \(S\) within rectangle D can be efficiently computed on the integration map \(I^{I}\) with only \((4-1)\) addition/subtraction operations, and the area \(S\) is  
\[S=I^{I}(V_{D})+I^{I}(V_{C})+I^{I}(V_{B})-I^{I}(V_{A}), \tag{29}\]  
where, \(V_{A}\), \(V_{B}\), \(V_{C}\) and \(V_{D}\) are the coordinates of four vertexes of \(R\) with clockwise order, and vertex \(A\) is located in the upper left corner. For more details about the integration map, please refer to [35]. However, this technique is only suitable for upright and horizontal kernels. In order to solve this problem, the polygon integration map was introduced and could be computed in real time [36]. It has been asserted that any polygonal area can be computed in real time. However, we note that the capitulation error cannot be eliminated, rendering the response inconsistent. In this paper, we combine the concepts from the integration map and from the image rotation and propose a new real-time implementation algorithm for computing responses of DoB kernels on natural images, namely osDoB. We then take the detection of lane markings as an example. As shown in Figure 8, the object scales of different part of the lane markings are diverse because of the perspective effect. The optimal kernels for different locations have different scales. The expected orientations of the local edges are also different. Parameter maps can be obtained using  
Figure 9: Illustration of shape of DoB kernels that are controlled by three parameters (**left**: 1 order DoB filter, **right**: 2 order DoB filter). the perspective effect, as shown in the figure (only the scale map and the orientation maps are shown, and the entire image has a single aspect ratio). In this paper, only one order DOB filter is adopted, as shown in left side of Figure 9. Instead of generating filters with different orientations, we keep the filter from rotating, but rotate the image at multiple orientations.