# _M\({}^{2}\)_Gf: Multi-Scale and Multi-Directional Gabor Filters for Image Edge Detection
## 2 Related Work
### The Multi-Scale and Multi-Directional Gabor Filter  
The Gabor filter, as a linear filter, is alike to the consciousness of the human visual because of the specific representations. Therefore, it is applied to the edge detection of the image. The response of the Gabor filter can be viewed as the product of sine/cosine wave Gaussian functions. The total, real and imaginary components of the Gabor filter are presented as  
\[g(x,y;f,\theta)=\frac{f^{2}}{\pi\gamma\eta}\exp\biggl{(}-\biggl{(}\frac{f^{2}}{ \gamma^{2}}x^{\prime 2}+\frac{f^{2}}{\eta^{2}}y^{\prime 2}\biggr{)}\biggr{)} \left(cos(2\pi fx^{\prime})+jsin(2\pi fx^{\prime})\right),\]  
\[x^{\prime}=x\cos\theta+y\sin\theta,\]  
\[y^{\prime}=-x\sin\theta+y\cos\theta, \tag{4}\]  
where \(x\) and \(y\) refer to the spatial coordinates into an image \(I\), and \(\gamma\) and \(\eta\) are constants, which represent the sharpness along the horizontal and vertical axis, respectively. The central frequency of the filter is \(f\). And \(\theta\) is the rotation angle. It can be observed from Equation (4) that the scale is related to central frequency \(f\). A low center frequency indicates a large-scale Gabor filter, which has a good noise robustness, while a high center frequency indicates a small-scale Gabor filter, which has better localization of the edges in the image. The real and imaginary components of the Gabor filter is shown in Figure 2a,b, respectively. The first column in the Figure 3, from left to right, is a ladder edge, an angular edge, a Y-shaped edge, an X-shaped edge and a star edge. And the second and third columns of the Figure 3 depict the absolute values of amplitude responses for different types of edge and Gabor filters in polar and Cartesian coordinates, respectively. The Gabor filter is anisotropic, which can effectively extract the information of edge. And the relatively different responses can be observed in the area \(T_{i}\) with different gray values. The multi-scale and multi-directional Gabor filter is extremely powerful for edge detection. Figure 2: Examples of real and imaginary components of Gabor filter with the \(\gamma=1.3\), \(\eta=2.5\), \(f=0.3\) and \(\theta=\frac{2}{3}\pi\). (**a**) A real component of Gabor filter. (**b**) An imaginary component of Gabor filter. Considering the more convenient expression of the multi-scale filter, the scale factor \(\sigma\) is added in the Gabor filter, and \(f_{\sigma}\) represents the central frequency of scale \(\sigma\). For an input discrete image \(I(\mathbf{z})\), \(\mathbf{z}=(u,v)^{T}\), in addition, the filter along different orientations needs to be used to extract local variation information around pixels. A set of discretized multi-scale Gabor filters can be obtained by taking different center frequencies \(f\):  
Figure 3: Magnitude responses of different types of edges and Gabor filters. (**a**) A ladder edge. (**d**) An angular edge. (**g**) A Y-shaped edge. (**j**) A X-shaped edge. (**m**) A star-shaped edge. (**b**,**e**,**h**,**k**,**n**) in the middle columns represent the absolute values of amplitude responses for different types of edges and Gabor filters in polar coordinates, respectively. (**c**,**f**,**i**,**l**,**o**) in the right columns represent the part of the magnitude responses for different types of edges and Gabor filters in Cartesian coordinates. \[\varphi(u,v;f,\sigma,k)= \frac{f_{\sigma}^{2}}{\pi\gamma\eta}\exp\left(-\left(\frac{f_{\sigma }^{2}}{\gamma^{2}}u^{\prime 2}+\frac{f_{\sigma}^{2}}{\eta^{2}}v^{\prime 2}\right)\right)\] \[\cdot\exp(j2\pi f_{\sigma}u^{\prime})\] \[u^{\prime}=u\cos\theta_{k}+v\sin\theta_{k},\] \[v^{\prime}=-u\sin\theta_{k}+v\cos\theta_{k},\] \[\theta_{k}=\frac{\pi k}{K},k=0,1,...,K-1 \tag{5}\]  
where the number of \(K\) is directions, and \(\theta_{k}\) is the \(k\)-th orientation.