# Efficient Filtering for Edge Extraction under Perspective Effect
## 2 Optimal Scale and Orientation Assignment
### Optimal Scale with Pre-Known Localized Target Size  
As has been pointed out by [PERSON] (2018), when the scale of the filter is small, compared to the target, detection of the local edge is unaffected by the nearby edges, and the noise is not well suppressed. At first, enlarging the scale of the filter does not change the signal or reduce the noise, but if the scale of the filter is too large, signal is also reduced due to the overlapping of the response of the nearby edges. As in [PERSON]'s work, the noise is supposed to be white and Gaussian. When the signal is a step edge at the original with limited extension, [PERSON] gave the best detection criteria as follows:  
\[C_{d}=\frac{\int_{-d}^{0}h(x)dx}{[\int_{-\infty}^{\infty}h^{2}(x)dx]^{\frac{1 }{2}}}. \tag{5}\]  
Usually, \(h(x,y)\) is an FIR filter, so there exist certain parameters that control the scale and shape of the filter. For example, the parameter \(\beta\) for the Shen filter Shen (1990) is as follows:  
\[h(x)=-sgn(x)e^{-\beta|x|}, \tag{6}\]  
The parameter \(\alpha\) for the Deriche filter Deriche (1970) is as follows:  
\[h(x)=-xe^{-\alpha|x|}, \tag{7}\]The parameter \(\sigma\) for FDOG is as follows:  
\[h(x)=-xe^{-\frac{x^{2}}{2\sigma^{2}}}, \tag{8}\]  
The parameter \(a\) for DoB is as follows:  
\[h(x)= \begin{cases}-sgn(x)&\text{for }x\in[-a,a]\\ 0&\text{otherwise},\end{cases} . \tag{9}\]  
Using dimensionless methods, similar to those of a previous study, we can deduce the optimal scale parameters for those filters when the input signal has a pre-known extension size [23]. Here, we list the results for several typical cases. **Case 1**: Using FDOG as the local filter for the 1D case. The FDOG kernel for the 1D case has the form of Equation (8). The optimal scale parameter for this case must follow the following equation:  
\[(2d^{2}+\sigma^{2})e^{\frac{-d^{2}}{2\sigma^{2}}}=\sigma^{2}. \tag{10}\]  
By solving this equation numerically, we can infer that, in order to detect a step edge at the original with the limited extension of \(d\), the optimal scale parameter for FDOG in the 1D case should be \(0.462578d\). **Case 2**: Using FDOG as the local filter for the 2D case. Here, we choose the 2D FDOG as the edge filter, so the kernel is as follows:  
\[h(x,y)=\frac{-x}{2\pi\lambda\sigma^{4}}e^{\frac{x^{2}}{2\sigma^{2}}+\frac{y^{ 2}}{2\lambda^{2}\sigma^{2}}}. \tag{11}\]  
Here, \(\lambda\) is the aspect ratio for the filter. The optimal scale parameter for this case must follow the equation:  
\[-\sigma^{2}+\sigma^{2}e^{\frac{-d^{2}}{2\sigma^{2}}}+d^{2}e^{\frac{-d^{2}}{2 \sigma^{2}}}=0. \tag{12}\]  
This means that aspect ratio \(\lambda\) has no effect on the optimal scale parameters for a given pre-known extension size. Solving this equation numerically, for FDOG in the 2D case with a pre-known extension size \(d\), the optimal scale parameter \(\sigma\) can be obtained as \(0.630835d\). This result is different from the result for the 1D case, as in Equation (8), and has nothing to do with the aspect ratio \(\lambda\). **Case 3**: Using DoB as the local filter for the 1D case. The DoB kernel in the 1D case has the form Equation (9). Using a similar deducing process to that with FDOG, we can attain the optimal scale parameter as:  
\[a=d. \tag{13}\]  
**Case 4**: Using DoB as the local filter for the 2D case. As in the 2D case, the DoB filter [26] can be defined as follows:  
\[h(x,y)= \begin{cases}\frac{1}{2a\sqrt{\lambda}}&\text{for }x\in(0,a),\ y\in(- \lambda a,\lambda a),\\ -\frac{1}{2a\sqrt{\lambda}}&\text{for }x\in(-a,0),\ y\in(-\lambda a,\lambda a ),\\ 0&\text{otherwise}.\end{cases}  \tag{14}\]  
Similar to the FDOG filter of Case 2, we have \(\lambda\) as the aspect ratio for the filter. The same result as Case 3 for the optimal scale parameter can be attained in this case, which is:  
\[a=d. \tag{15}\]In all of the above cases, we deduce the optimal scale parameter for the pre-known signal extension size by only using the first criterion of Canny: the best detection.