# Coherence Enhancement Based on Recursive Anisotropic Scale-Space with Adaptive Kernels
## 4 Detection of Curvilinear Structures  
In this section, we present an algorithm to detect curvilinear structures based on the representation obtained by the proposed recursive anisotropic diffusion process. Let \(u\colon\Omega\mapsto\mathbb{R}\) be a representation obtained from the proposed algorithm described in Algorithm 1, where the anisotropic diffusion process is recursively applied. The detection of curvilinear structures is often desired in a variety of imagery domains such as those involving medical images, satellite images, electronic designs, and maps. Features of interest forming curvilinear structures are better characterized when insignificant details are suppressed so that these curvilinear structures can be more easily detected. An algorithm for detecting curvilinear structures is developed based on the analysis of local image features [41; 42; 43], where the directional derivatives are used to determine the orientations of the curvilinear features as proposed in [4]. Let \(\gamma\colon\mathbb{C}^{1}\mapsto\Omega\) be a parameterized curve from \(t\in[0,1]\subset\mathbb{C}^{1}\). The magnitude of the second derivative \(\gamma^{\prime\prime}(t)\) at the point where \(\gamma^{\prime}(t)=0\) can be used as a saliency measure to characterize linear features. Positive contrast due to bright lines on a dark background is characterized by \(\gamma^{\prime\prime}(t)\ll 0\), and negative contrast due to dark lines on a bright background is characterized by \(\gamma^{\prime\prime}(t)\gg 0\). The characteristic kernel \(f(x)\) for linear features can be defined by  
\[f(x)=\begin{cases}h&:\|x\|\leq w,\\ 0&:\|x\|>w\end{cases} \tag{15}\]  
where \(h>0\) is a function value and the kernel has the same shape as a Heaviside function with a threshold \(w>0\). It is often useful to relax the shape of the kernel for computational convenience and numerical stability by using the characteristic kernel relaxed with respect to linear features defined by  
\[f(x)=\begin{cases}h(1-(x-w)^{2})&:\|x\|\leq w,\\ 0&:\|x\|>w\end{cases} \tag{16}\]  
which is a round bell-shaped function with a threshold \(w>0\). The convolution of the kernel function \(f\) with a Gaussian kernel is then used to compute the responses in the detection of linear features. Denoting the first and second derivatives in the \(x_{1}\) and \(x_{2}\) directions as \(d_{x_{1}}\), \(d_{x_{2}}\), \(d_{x_{1}x_{1}}\), \(d_{x_{2}x_{2}}\), respectively, we have  
\[d_{x_{1}}=G_{x_{1}}*f(x),\qquad d_{x_{2}}=G_{x_{2}}*f(x),\qquad d_{x_{1}x_{1}}= G_{x_{1}x_{1}}*f(x),\qquad d_{x_{2}x_{2}}=G_{x_{2}x_{2}}*f(x), \tag{17}\]  
where \(G_{x_{1}},G_{x_{2}}\) and \(G_{x_{1}x_{1}},G_{x_{2}x_{2}}\) denote the first and second derivatives of the Gaussian kernel \(G\) with respect to the \(x_{1}\) and \(x_{2}\) directions, respectively. The direction of the linear features present on the curve \(\gamma(t)\) can be obtained by the eigen-analysis of the following Hessian matrix:  
\[H(x)=\begin{bmatrix}d_{x_{1}x_{1}}&d_{x_{1}x_{2}}\\ d_{x_{1}x_{2}}&d_{x_{2}x_{2}}\end{bmatrix}. \tag{18}\]  
The normal direction to the curve \(\gamma(t)\) can be obtained from the eigenvectors of the Hessian matrix \(H\). The absolute values of the eigenvalues are used to detect linear features, which tend to have local eigenvalue maxima along the normal direction of the curve. The linear features can be detected by the saliency measure \(\theta\) proposed in [41]. It is defined as  
\[\theta=\frac{d_{x_{1}}\gamma_{x_{1}}+d_{x_{2}}\gamma_{x_{2}}}{d_{x_{1}x_{1}} \gamma_{x_{1}}^{2}+2d_{x_{1}x_{2}}\gamma_{x_{1}}\gamma_{x_{2}}+d_{x_{2}x_{2}} \gamma_{x_{2}}^{2}}. \tag{19}\]  
It is likely that a stronger linear feature will have a larger saliency value. This can be used as an indicator in the detection of curvilinear features.