RIDGE DETECTION USING SAVITZKY-GOLAY FILTERING AND STEERABLE SECOND-ORDER GAUSSIAN DERIVATIVES Abin Jose, Sunder Ram Krishnan, and Chandra Sekhar Seelamantula Department of Electrical Engineering, Indian Institute of Science, Bangalore E-mails: abintom[email protected], [email protected], [email protected]

ABSTRACT We propose a method for ridge detection at different widths using second-order Gaussian derivative masks. The width of the ridge extracted varies depending on the mask size and its parameter, σ. In the proposed method, the ridge orientations are estimated as an initial step by finding the zerocrossings of the first derivative of the second directional derivative. In order to compute the orientations from discrete samples of the image, we make use of the recently popularized Savitzky-Golay (S-G) filter. Once the directions are estimated, ridge detection is accomplished by steering a second-order Gaussian kernel, which closely approximates the ideal ridge template, in the computed directions. The method is computationally effective on two accounts: (1) The ridge orientations are determined efficiently using S-G filtering; and (2) Once the orientations are estimated, the steerability property is used to detect ridges. The output of the ridge detector is then improved using non-maximal suppression and hysteresis thresholding. The results obtained are compared with an efficient benchmark method for ridge extraction. Index Terms— Ridge detection, Savitzky-Golay filtering, Steerable filters, Second-order Gaussian derivatives. 1. INTRODUCTION Image feature extraction forms an important initial step in most computer vision algorithms. Ridges represent key features in an image, and our goal in this work is to propose an efficient method for ridge detection in images. Typically, images consist of ridges and valleys. We identify a region of a digital image as having a ridge if it has a string of connected pixels with intensities higher than those of the neighboring pixels. In the case of a region comprising a valley, the intensities of the connected sequence of pixels would be lower than those of their neighbors. Thus, we observe that the ideal definition of a ridge closely follows its physical meaning. In case of the allied problem of edge detection, we are interested in capturing the boundary of an object, whereas in ridge detection, our intention is to capture the major axis that symmetrically divides the object. Ridge detection finds applications in the areas of fingerprint recognition [1] and biomedical imaging, such as for detection of blood veins in ophthalmic images [2] and deoxyribonucleic acid (DNA) filaments in noisy micrographs [3]. Another application area is that of extracting information from satellite images [4]. 1.1. Related work Different mathematical models and definitions for ridges have been previously proposed in the literature, which form the basis for deThis work is supported by the Robert Bosch Centre for Cyber Physical Systems, Indian Institute of Science, Bangalore.

978-1-4799-2341-0/13/$31.00 ©2013 IEEE

signing algorithms for detecting ridges. Even though there are multiple ways of defining ridges (a few of them are mentioned below), all ridge detectors are required to satisfy certain criteria [5]. One condition is that identification of a ridge should be solely based on information derived from a neighborhood local to the point under consideration. Also, it is desirable that the ridge detector be invariant under translations and rotations of spatial variables. Hessian-based methods form an important class of ridge detection algorithms. An early work in this direction is that of Saint-Venant, who considered loci of minimum gradient magnitude along the level curves of the feature [6]. In 1981, Haralick [7] put forth a formulation for identifying ridges/valleys, and proposed a method for ridge extraction, wherein he initially determined the ridge orientations by considering the zerocrossings of the first directional derivative in a direction in which the second directional derivative is maximized/minimized. These works followed what is referred to as the “height definition” of a ridge. In the present work, we adopt a methodology for computing ridge orientations on the lines of the one followed in Haralick’s work. An extension of his technique to higher dimensional images can be found in [5]. With the goal of segmenting intensity images, ridges may be defined in terms of slope district boundaries [8], and a discrete ridge definition can be found in [9]. Other ridge definitions make use of differential geometry ideas, for instance, Gauch and Pizer [10] related ridges/valleys with the extrema of the curvature of the feature’s level curves. Freeman and Adelson [11], in a classic paper, demonstrated a methodology for adaptively steering a filter to a specified direction, and computing the output of the filter at different orientations. They showed that such an oriented filter can be generated by a suitable linear combination of a set of basis filters that are rotated versions of the original filter. Applications of steerable filters in tasks such as edge detection, angularly adaptive filtering are discussed in their paper. In this paper, we propose to steer the chosen ridge filter to computed ridge orientations deriving motivation out of their work. A powerful generic approach for feature detector design from a class of steerable functions was proposed by Jacob and Unser [12]. In their work, they suggest to choose the ridge direction by solving a matched filtering problem, which corresponds to maximum likelihood estimation in the presence of Gaussian noise. The corresponding steerable filter detectors are designed by optimizing a Canny-like criterion [13]. 1.2. This paper We propose a computationally efficient method for ridge extraction. The technique consists of two stages. In the initial stage, ridge orientations are determined as the angles at which the first derivative of the second directional derivative has a zerocrossing, and then considering the sign of its second derivative. Derivatives are computed in a direction orthogonal to the feature to be detected. The analytically computed directions are observed to be dependent on image partial

3059

ICIP 2013

derivatives, which need to be obtained from discrete samples of the image. This problem of derivative computation is addressed using Savitzky-Golay (S-G) filtering [14], an idea recently discussed by Schafer [15] in IEEE Signal Processing Magazine. These are finite impulse filters arising from least-squares (LS) data regression using fixed-order polynomials over fixed neighborhoods. With data centering, the smoothed derivatives are observed to be equal to LS polynomial coefficients, which can be effectively computed using convolutions with fixed and pre-computed S-G filter coefficients. Once the ridge directions are arrived at, a second-order Gaussian derivative filter, chosen as an approximation to the ideal ridge filter template, is steered to those directions so as to result in maximal filter response on convolving with the image. The detection results are fine-tuned by employing non-maximal suppression and hysteresis thresholding. The proposed method is simple and computationally efficient because of efficient partial derivative computation using S-G filtering (which provides added noise robustness due to its bandpass nature), and because of employing the steerability property. Comparisons with the robust steerable detector of [12] are provided. Organization of the paper: In Section 2, we explain how the orientation of ridges is extracted using directional derivatives and bandpass S-G filtering. In Section 3, we detail the concept of steerable filters, and discuss the choice of second-order Gaussian derivative filter as an approximation for the idealized ridge filter. We also discuss the choice of the mask parameters in this section. The experimental results are illustrated in Section 4, and concluding remarks are drawn in Section 5. 2. ORIENTATION ESTIMATION OF RIDGES 2.1. Direction of ridges from directional derivatives The initial step for detecting ridges in an image is to estimate the orientation of ridges. Deriving motivation out of the work of Haralick [7], we propose to determine the ridge orientations by considering the zerocrossings of the first derivative of the second directional derivative, and noting the sign of its second derivative. Consider a direction θ and the unit vector in that direction: u = [cos θ sin θ]T . Let g(x, y) denote the continuous-domain image. The second directional derivative at pixel location (x, y), uT ∇2 g(x, y)u (∇2 g denotes the Hessian of g) is equal to gθ00 (x, y) =

∂2g ∂2g ∂2g cos θ sin θ + cos2 θ + 2 sin2 θ. ∂x2 ∂x∂y ∂y 2

In order to determine the direction θ that maximizes/minimizes the second directional derivative, we differentiate gθ00 with respect to θ, which gives 2 ∂gθ00 ∂2g ∂ g ∂2g (x, y) = 2 cos 2θ + sin 2θ − , ∂θ ∂x∂y ∂y 2 ∂x2 and set it equal to zero. The value of θ that extremizes gθ00 turns out to be ∂2g 2 1 ∂x∂y . θ∗ = arc tan (1) 2 2 ∂ g ∂2g − ∂x2 ∂y 2

compute these partial derivatives from the available discrete data?.” Taking motivation from the classic work of the chemists Savitzky and Golay [14] and the article by Schafer [15], we note that this question is readily answered by employing a LS polynomial fit of a particular order over a fixed pixel neighborhood, and then resampling the fit. In this work, we have made use of a two variable cubic polynomial fit to a pixel neighborhood of size N × N . The bicubic polynomial function is given by g(x, y) = c1 + c2 x + c3 y + c4 x2 + c5 xy +c6 y 2 + c7 x3 + c8 x2 y + c9 xy 2 + c10 y 3 .

2.3. Computing ridge orientations With the derivatives estimated in the manner detailed above, the direction θ∗ can equivalently be expressed in terms of cj s as in (2) as follows: 1 c5 ∗ θ = arc tan . 2 c4 − c6 By analytically computing the second derivative of the second directional derivative with respect to θ, one can verify that the directions π that extremize the second directional derivative differ by radians. 2 ∂ 2 gθ00 is negative, then it corresponds to a maximum That is, if ∂θ2 θ=θ∗ (a ridge), and the direction of the minimum (a valley) is orthogonal to that given by θ∗ , and vice versa. Thus finally, we arrive at the following methodology for finding out the ridge orientations: ∂ 2 gθ00 < 0 : θ∗ is a ridge direction. ∂θ2 θ=θ∗ ∂ 2 gθ00 π > 0 : θ∗ + is a ridge direction. ∂θ2 ∗ 2 θ=θ

Once the ridge orientations are determined, the next step involves steering an appropriate mask in the computed directions so as to achieve maximum response at the ridge points. This aspect is discussed in the next section.

2.2. Savitzky-Golay filters for derivative estimation Note that the expression for θ∗ depends on the partial derivatives of the image of which, we have a finite number of discrete samples. Presently, the question to be addressed is,“How do we efficiently

(2)

Again, considering the one-dimensional case, Savitzky and Golay had shown that computation of the LS polynomial coefficients for a fixed polynomial order and neighborhood size is equivalent to convolution with a fixed and pre-computed impulse response, the resulting filters are now referred to as “Savitzky-Golay filters.” S-G filters have also been employed in the field of image processing, and masks for different polynomial orders and sizes have been pre-computed, and are readily available. These coefficients can be calculated by writing out the LS estimate derived as a solution to a set of normal equations. We also note that this approach to computing the derivatives inherently produces smooth values of the derivatives, as LS polynomial fitting is equivalent to lowpass filtering of the image. The subsequent derivative computation, in cascade with LS regression, results in bandpass filters, which when convolved with the image, gives the polynomial coefficients. Assuming that the pixel at which derivatives are to be estimated is located at the origin, each of the partial derivatives in (1) is seen to be equal to a certain LS polynomial coefficient (up to a scale factor), and from the discussion above, they can be obtained with minimal computations.

3. RIDGE DETECTION USING STEERABLE FILTERS An idealized ridge is depicted in Figure 1 (a). We employ a smooth, differentiable approximation of the template, namely, a second-order

3060

(a)

(b)

Fig. 1.

(c)

(d)

(Color online) (a) Ideal ridge, (b) Chosen ridge filter, Filter oriented at: (c) 0, (d)

Gaussian derivative as the mask, the motivation being that it closely resembles a ridge (cf. Figure 1 (b)). If we consider the image to be a linear combination of different features, the filter chosen should be such that it gives maximum response when it encounters a ridge. Since the ridge orientations are available from the formulation detailed in the previous section, the problem of ridge detection now reduces to one of steering the chosen template filter in that particular direction. We use the concept of steerabilty introduced by Freeman and Adelson [11] for adapting the filter orientation to a desired direction. They discuss conditions for a function to be steerable,and put forth a technique for orienting a filter in a chosen direction by using basis functions that are rotated versions of the function itself. The coefficients that are used to linearly combine the basis functions to result in the steered output are termed as the interpolation functions. Formally, a function h(x, y) is said to be “steerable” if it can L X `i (θ)h(x, y; θi ), where be expressed in the form h(x, y; θ) =

(e) π π , and (e) radians. 4 2

the quality of ridge detection are σ and the window size. The choice of σ is based on the scale of the ridge to be detected. The scale of the detected ridges varies directly as the value of σ. The size of the mask is then fixed according as the selected σ value. Specifically, the window size is chosen such that the function variation is captured in the values of the mask for a specific σ. That is, the mask size should be increased with increasing values of σ. 4. EXPERIMENTAL RESULTS In this section, we present ridge detection results obtained using the proposed technique and that in [12]1 on both clean images, and images with real-world noise. The results are presented for different scales in either case on carefully chosen test images. Note that results for the proposed technique were obtained after an initial smoothing operation. This is to take into account Canny’s first criterion of improving the signal-to-noise ratio.

i=1

`i s are the interpolation functions and the bases, h(x, y; θi ) are rotated versions of h(x, y). The Gaussian second derivative steered in direction θ (taken in counter clockwise sense) is given by π F (x, y; θ, σ) = `1 (θ)F (x, y; 0, σ) + `2 (θ)F x, y; , σ 3 2π +`3 (θ)F x, y; ,σ , 3 where the bases are −(x2 + y 2 ) (x2 − σ 2 ) 2σ 2 e , F (x, y; 0, σ) = 0.4607 σ4 −(x2 + y 2 ) π xy 2σ 2 F (x, y; , σ) = 0.4607 4 e , 3 σ 2 −(x + y 2 ) (y 2 − σ 2 ) 2π 2σ 2 F (x, y; , σ) = 0.4607 e , 3 σ4 and the `i s are given by the expressions: `1 (θ) = cos2 θ, `2 (θ) = − sin 2θ, and `3 (θ) = sin2 θ. π π We show the filter steered in directions θ = 0, , and radians in 4 2 Figure 1 (c)–(e), respectively. By steering the Gaussian second-order derivative in the direction θ∗ , we could extract ridges effectively as the convolution of the filter and the ridge gives maximum response in that direction, and leads to added noise robustness. 3.1. Choice of σ and window size Once the filter is steered in the ridge direction, masks for detecting ridges are generated by sampling the second-order Gaussian derivative on a uniform grid. The two parameters of the mask that affect

4.1. Results on clean images First, we considered an ophthalmic image and generated results with N = 9, σ = 1 and N = 15, σ = 2 using our method, and compared them with the second-order response obtained using the algorithm in [12] for feature width 2. These results are depicted in Figure 2. The exudates (lesions) detected using our method have similar shape as in the original image when we use a higher scale (N = 15, σ = 2), whereas they are slightly oversmoothed and smeared in case of the ridge detector in [12]. This aspect is made clear in the zoomed-in versions of the images highlighted in the second row of Figure 2. Next, we chose a zebra image, which presents ridges with larger scale in order to study the effect of choosing large σ values on the quality of detected features. We present the results of our method in this case with N = 35, σ = 7 and N = 29, σ = 5 followed by thresholding, and those resulting from the technique compared herein (fourth-order response with feature width 9) in Figure 3. We observe that the results obtained from the proposed method with large σ are better compared with the results of the ridge detector proposed in [12], which are oversmoothed. 4.2. Results on noisy images Presently, we consider the performance of the algorithms on noisy cryo-electron micrographs of DNA filaments. Ridge detection is carried out with N = 21, σ = 3 with and without non-maximal suppression, followed by hysteresis thresholding using the proposed method. The results are shown in Figure 4. We note that the detection results are improved, if we use the non-maximal suppression

3061

1A

Java plug-in is available at http://bigwww.epfl.ch.

(a) Fig. 2.

(b)

(c)

(d)

(a) Original image [16], (b) Proposed method with N/σ: 9/1, (c) N/σ: 15/2, and (d) Ridge detector in [12] (feature width: 2).

(a)

(b)

(c)

(a)

(b)

(c)

(d)

(d)

Fig. 3. (a) Original image [17], (b) Proposed method with N/σ: 35/7, (c) N/σ: 29/5, and (d) Ridge detector in [12] (feature width: 9).

block. Comparing with the benchmark algorithm (fourth-order response, feature width 2), we observe that the results of the detector in [12] are better in the sense that the detected ridges are at a finer scale. However, the results obtained using our technique exhibits lower background noise. 5. CONCLUSIONS We addressed the problem of ridge detection in images. A simple, two-step approach was developed for solving the feature extraction problem. The first step comprised computing the ridge orientations at all points using zerocrossings of the second directional derivative’s first derivative. The analytically computed orientation was found to depend on the image partial derivatives. Smooth estimates of the partial derivatives are obtained using LS polynomial fitting and resampling at the point of interest, the operation being equivalent to bandpass, linear, shift-invariant filtering referred to as Savitzky-Golay filtering. We noted that the filter coefficients can be pre-computed for a particular polynomial order and window size using standard LS procedures. This provided an efficient filtering solution to the prob-

Fig. 4. (a) Noisy micrograph [18], (b) Proposed method with N/σ: 21/3, (c) With non-maximal suppression, and (d) Ridge detector in [12] (feature width: 2). lem of smooth derivative estimation from discrete samples of a twodimensional function. Subsequent to estimating the ridge direction, we motivated the choice of a second-order Gaussian derivative filter as an approximation to the desired ridge filter template. The filter was then steered to the ridge orientations and convolved with the image to result in maximum responses at ridge points. The results of the ridge detection block were further improved using non-maximal suppression and hysteresis thresholding. The algorithm was tested on some test images, and the results obtained were compared with a performant method of ridge detection. The results were comparable with those obtained from the benchmark technique in most cases, with the proposed method giving marginally superior results in case of features with a larger scale and for ophthalmic images with lesions. Optimally choosing the σ parameter of the ridge filter, extending the method to higher dimensions, and studying the effect of S-G filters of different orders and window sizes [19] are further research directions.

3062

6. REFERENCES [1] A. Jain, L. Hong, and R. Bolle, “On-line fingerprint verification,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 19. no. 4, pp. 302–314, Apr. 1997. [2] Y. Li et al., “Ridge-branch-based blood vessel detection algorithm for multimodal retinal images,” in Proc. SPIE, vol. 7259, pp. 1–12, 2009. [3] M. Jacob, T. Blu, and M. Unser, “3D reconstruction of DNA filaments from stereo cryo-electron micrographs,” in Proc. IEEE Int. Symp. Biomedical Imaging: Macro to Nano, vol. 2, pp. 597–600, 2002. [4] J. M. Weiss, “Automatic detection of ship tracks in satellite imagery,” in Proc. IEEE Int. Conf. Geosci. and Remote Sensing (IGARSS ’97), vol. 1, pp. 160–162, Aug. 1997. [5] D. Eberly, R. Gardner, B. Morse, S. Pizer, and C. Scharlach, “Ridges for Image Analysis,” J. Math. Imaging and Vision, vol. 4, no. 4, pp. 353–373, Dec. 1994. [6] M. D. Saint-Venant, “Surfaces plus grande pente constitues sur des lignes courbes,” Bulletin de la soc. philomath. de Paris, pp. 24–30, Mar. 1852. [7] R. Haralick, “Ridges and valleys on digital images,” Comput. Vision, Graph., and Image Process., vol. 22, no. 10, pp. 28–38, Apr. 1983. [8] A. C. F. Colchester, “Network representation of 2D and 3D images,” in 3D Imaging in Medicine, K. H. Hoehne, H. Fuchs, and S. Pizer (eds.), Berlin, Germany: Springer-Verlag, 1990, pp. 45–62. [9] J. L. Crowley and A. C. Parker, “A representation for shape based on peaks and ridges in the difference of low pass transform,” IEEE Trans. Pattern Anal. and Mach. Intell., vol. 6, no. 2, pp. 156–170, 1984. [10] J. Gauch and S. Pizer, “Multiresolution analysis of ridges and valleys in grey-scale images,” IEEE Trans. Pattern Anal. and Mach. Intell., vol. 15, no. 6, pp. 635–646, June 1993. [11] W. T. Freeman and E. H. Adelson, “The design and use of steerable filters,” IEEE Trans. Pattern Anal. and Mach. Intell., vol. 13, no. 9, pp. 891–906, Sep. 1991. [12] M. Jacob and M. Unser, “Design of steerable filters for feature detection using Canny-like criteria,” IEEE Trans. Pattern Anal. and Mach. Intell., vol. 26, no. 8, pp. 1007–1019, Aug. 2004. [13] J. Canny, “A computational approach to edge detection,” IEEE Trans. Pattern Anal. and Mach. Intell., vol. 8, no. 6, pp. 679– 698, 1986. [14] A. Savitzky and M. J. E. Golay, “Smoothing and differentiation of data by simplified least squares procedures,” Anal. Chem., vol. 36, no. 8, pp. 1627–1639, July 1964. [15] R. W. Schafer, “What is a Savitzky-Golay filter?,” IEEE Signal Process. Mag., vol. 28, no. 4, pp. 111–117, July 2011. [16] http://www2.it.lut.fi/project/imageret/diaretdb1/. [17] http://wall.alphacoders.com/big.php?i=12931. [18] http://www.fidelitysystems.com/Unlinked DNA.html. [19] S. R. Krishnan and C. S. Seelamantula, “On the selection of optimum Savitzky-Golay filters,” IEEE Trans. Signal Process., vol. 61, no. 2, pp. 380–391, Jan. 2013.

3063

ABSTRACT We propose a method for ridge detection at different widths using second-order Gaussian derivative masks. The width of the ridge extracted varies depending on the mask size and its parameter, σ. In the proposed method, the ridge orientations are estimated as an initial step by finding the zerocrossings of the first derivative of the second directional derivative. In order to compute the orientations from discrete samples of the image, we make use of the recently popularized Savitzky-Golay (S-G) filter. Once the directions are estimated, ridge detection is accomplished by steering a second-order Gaussian kernel, which closely approximates the ideal ridge template, in the computed directions. The method is computationally effective on two accounts: (1) The ridge orientations are determined efficiently using S-G filtering; and (2) Once the orientations are estimated, the steerability property is used to detect ridges. The output of the ridge detector is then improved using non-maximal suppression and hysteresis thresholding. The results obtained are compared with an efficient benchmark method for ridge extraction. Index Terms— Ridge detection, Savitzky-Golay filtering, Steerable filters, Second-order Gaussian derivatives. 1. INTRODUCTION Image feature extraction forms an important initial step in most computer vision algorithms. Ridges represent key features in an image, and our goal in this work is to propose an efficient method for ridge detection in images. Typically, images consist of ridges and valleys. We identify a region of a digital image as having a ridge if it has a string of connected pixels with intensities higher than those of the neighboring pixels. In the case of a region comprising a valley, the intensities of the connected sequence of pixels would be lower than those of their neighbors. Thus, we observe that the ideal definition of a ridge closely follows its physical meaning. In case of the allied problem of edge detection, we are interested in capturing the boundary of an object, whereas in ridge detection, our intention is to capture the major axis that symmetrically divides the object. Ridge detection finds applications in the areas of fingerprint recognition [1] and biomedical imaging, such as for detection of blood veins in ophthalmic images [2] and deoxyribonucleic acid (DNA) filaments in noisy micrographs [3]. Another application area is that of extracting information from satellite images [4]. 1.1. Related work Different mathematical models and definitions for ridges have been previously proposed in the literature, which form the basis for deThis work is supported by the Robert Bosch Centre for Cyber Physical Systems, Indian Institute of Science, Bangalore.

978-1-4799-2341-0/13/$31.00 ©2013 IEEE

signing algorithms for detecting ridges. Even though there are multiple ways of defining ridges (a few of them are mentioned below), all ridge detectors are required to satisfy certain criteria [5]. One condition is that identification of a ridge should be solely based on information derived from a neighborhood local to the point under consideration. Also, it is desirable that the ridge detector be invariant under translations and rotations of spatial variables. Hessian-based methods form an important class of ridge detection algorithms. An early work in this direction is that of Saint-Venant, who considered loci of minimum gradient magnitude along the level curves of the feature [6]. In 1981, Haralick [7] put forth a formulation for identifying ridges/valleys, and proposed a method for ridge extraction, wherein he initially determined the ridge orientations by considering the zerocrossings of the first directional derivative in a direction in which the second directional derivative is maximized/minimized. These works followed what is referred to as the “height definition” of a ridge. In the present work, we adopt a methodology for computing ridge orientations on the lines of the one followed in Haralick’s work. An extension of his technique to higher dimensional images can be found in [5]. With the goal of segmenting intensity images, ridges may be defined in terms of slope district boundaries [8], and a discrete ridge definition can be found in [9]. Other ridge definitions make use of differential geometry ideas, for instance, Gauch and Pizer [10] related ridges/valleys with the extrema of the curvature of the feature’s level curves. Freeman and Adelson [11], in a classic paper, demonstrated a methodology for adaptively steering a filter to a specified direction, and computing the output of the filter at different orientations. They showed that such an oriented filter can be generated by a suitable linear combination of a set of basis filters that are rotated versions of the original filter. Applications of steerable filters in tasks such as edge detection, angularly adaptive filtering are discussed in their paper. In this paper, we propose to steer the chosen ridge filter to computed ridge orientations deriving motivation out of their work. A powerful generic approach for feature detector design from a class of steerable functions was proposed by Jacob and Unser [12]. In their work, they suggest to choose the ridge direction by solving a matched filtering problem, which corresponds to maximum likelihood estimation in the presence of Gaussian noise. The corresponding steerable filter detectors are designed by optimizing a Canny-like criterion [13]. 1.2. This paper We propose a computationally efficient method for ridge extraction. The technique consists of two stages. In the initial stage, ridge orientations are determined as the angles at which the first derivative of the second directional derivative has a zerocrossing, and then considering the sign of its second derivative. Derivatives are computed in a direction orthogonal to the feature to be detected. The analytically computed directions are observed to be dependent on image partial

3059

ICIP 2013

derivatives, which need to be obtained from discrete samples of the image. This problem of derivative computation is addressed using Savitzky-Golay (S-G) filtering [14], an idea recently discussed by Schafer [15] in IEEE Signal Processing Magazine. These are finite impulse filters arising from least-squares (LS) data regression using fixed-order polynomials over fixed neighborhoods. With data centering, the smoothed derivatives are observed to be equal to LS polynomial coefficients, which can be effectively computed using convolutions with fixed and pre-computed S-G filter coefficients. Once the ridge directions are arrived at, a second-order Gaussian derivative filter, chosen as an approximation to the ideal ridge filter template, is steered to those directions so as to result in maximal filter response on convolving with the image. The detection results are fine-tuned by employing non-maximal suppression and hysteresis thresholding. The proposed method is simple and computationally efficient because of efficient partial derivative computation using S-G filtering (which provides added noise robustness due to its bandpass nature), and because of employing the steerability property. Comparisons with the robust steerable detector of [12] are provided. Organization of the paper: In Section 2, we explain how the orientation of ridges is extracted using directional derivatives and bandpass S-G filtering. In Section 3, we detail the concept of steerable filters, and discuss the choice of second-order Gaussian derivative filter as an approximation for the idealized ridge filter. We also discuss the choice of the mask parameters in this section. The experimental results are illustrated in Section 4, and concluding remarks are drawn in Section 5. 2. ORIENTATION ESTIMATION OF RIDGES 2.1. Direction of ridges from directional derivatives The initial step for detecting ridges in an image is to estimate the orientation of ridges. Deriving motivation out of the work of Haralick [7], we propose to determine the ridge orientations by considering the zerocrossings of the first derivative of the second directional derivative, and noting the sign of its second derivative. Consider a direction θ and the unit vector in that direction: u = [cos θ sin θ]T . Let g(x, y) denote the continuous-domain image. The second directional derivative at pixel location (x, y), uT ∇2 g(x, y)u (∇2 g denotes the Hessian of g) is equal to gθ00 (x, y) =

∂2g ∂2g ∂2g cos θ sin θ + cos2 θ + 2 sin2 θ. ∂x2 ∂x∂y ∂y 2

In order to determine the direction θ that maximizes/minimizes the second directional derivative, we differentiate gθ00 with respect to θ, which gives 2 ∂gθ00 ∂2g ∂ g ∂2g (x, y) = 2 cos 2θ + sin 2θ − , ∂θ ∂x∂y ∂y 2 ∂x2 and set it equal to zero. The value of θ that extremizes gθ00 turns out to be ∂2g 2 1 ∂x∂y . θ∗ = arc tan (1) 2 2 ∂ g ∂2g − ∂x2 ∂y 2

compute these partial derivatives from the available discrete data?.” Taking motivation from the classic work of the chemists Savitzky and Golay [14] and the article by Schafer [15], we note that this question is readily answered by employing a LS polynomial fit of a particular order over a fixed pixel neighborhood, and then resampling the fit. In this work, we have made use of a two variable cubic polynomial fit to a pixel neighborhood of size N × N . The bicubic polynomial function is given by g(x, y) = c1 + c2 x + c3 y + c4 x2 + c5 xy +c6 y 2 + c7 x3 + c8 x2 y + c9 xy 2 + c10 y 3 .

2.3. Computing ridge orientations With the derivatives estimated in the manner detailed above, the direction θ∗ can equivalently be expressed in terms of cj s as in (2) as follows: 1 c5 ∗ θ = arc tan . 2 c4 − c6 By analytically computing the second derivative of the second directional derivative with respect to θ, one can verify that the directions π that extremize the second directional derivative differ by radians. 2 ∂ 2 gθ00 is negative, then it corresponds to a maximum That is, if ∂θ2 θ=θ∗ (a ridge), and the direction of the minimum (a valley) is orthogonal to that given by θ∗ , and vice versa. Thus finally, we arrive at the following methodology for finding out the ridge orientations: ∂ 2 gθ00 < 0 : θ∗ is a ridge direction. ∂θ2 θ=θ∗ ∂ 2 gθ00 π > 0 : θ∗ + is a ridge direction. ∂θ2 ∗ 2 θ=θ

Once the ridge orientations are determined, the next step involves steering an appropriate mask in the computed directions so as to achieve maximum response at the ridge points. This aspect is discussed in the next section.

2.2. Savitzky-Golay filters for derivative estimation Note that the expression for θ∗ depends on the partial derivatives of the image of which, we have a finite number of discrete samples. Presently, the question to be addressed is,“How do we efficiently

(2)

Again, considering the one-dimensional case, Savitzky and Golay had shown that computation of the LS polynomial coefficients for a fixed polynomial order and neighborhood size is equivalent to convolution with a fixed and pre-computed impulse response, the resulting filters are now referred to as “Savitzky-Golay filters.” S-G filters have also been employed in the field of image processing, and masks for different polynomial orders and sizes have been pre-computed, and are readily available. These coefficients can be calculated by writing out the LS estimate derived as a solution to a set of normal equations. We also note that this approach to computing the derivatives inherently produces smooth values of the derivatives, as LS polynomial fitting is equivalent to lowpass filtering of the image. The subsequent derivative computation, in cascade with LS regression, results in bandpass filters, which when convolved with the image, gives the polynomial coefficients. Assuming that the pixel at which derivatives are to be estimated is located at the origin, each of the partial derivatives in (1) is seen to be equal to a certain LS polynomial coefficient (up to a scale factor), and from the discussion above, they can be obtained with minimal computations.

3. RIDGE DETECTION USING STEERABLE FILTERS An idealized ridge is depicted in Figure 1 (a). We employ a smooth, differentiable approximation of the template, namely, a second-order

3060

(a)

(b)

Fig. 1.

(c)

(d)

(Color online) (a) Ideal ridge, (b) Chosen ridge filter, Filter oriented at: (c) 0, (d)

Gaussian derivative as the mask, the motivation being that it closely resembles a ridge (cf. Figure 1 (b)). If we consider the image to be a linear combination of different features, the filter chosen should be such that it gives maximum response when it encounters a ridge. Since the ridge orientations are available from the formulation detailed in the previous section, the problem of ridge detection now reduces to one of steering the chosen template filter in that particular direction. We use the concept of steerabilty introduced by Freeman and Adelson [11] for adapting the filter orientation to a desired direction. They discuss conditions for a function to be steerable,and put forth a technique for orienting a filter in a chosen direction by using basis functions that are rotated versions of the function itself. The coefficients that are used to linearly combine the basis functions to result in the steered output are termed as the interpolation functions. Formally, a function h(x, y) is said to be “steerable” if it can L X `i (θ)h(x, y; θi ), where be expressed in the form h(x, y; θ) =

(e) π π , and (e) radians. 4 2

the quality of ridge detection are σ and the window size. The choice of σ is based on the scale of the ridge to be detected. The scale of the detected ridges varies directly as the value of σ. The size of the mask is then fixed according as the selected σ value. Specifically, the window size is chosen such that the function variation is captured in the values of the mask for a specific σ. That is, the mask size should be increased with increasing values of σ. 4. EXPERIMENTAL RESULTS In this section, we present ridge detection results obtained using the proposed technique and that in [12]1 on both clean images, and images with real-world noise. The results are presented for different scales in either case on carefully chosen test images. Note that results for the proposed technique were obtained after an initial smoothing operation. This is to take into account Canny’s first criterion of improving the signal-to-noise ratio.

i=1

`i s are the interpolation functions and the bases, h(x, y; θi ) are rotated versions of h(x, y). The Gaussian second derivative steered in direction θ (taken in counter clockwise sense) is given by π F (x, y; θ, σ) = `1 (θ)F (x, y; 0, σ) + `2 (θ)F x, y; , σ 3 2π +`3 (θ)F x, y; ,σ , 3 where the bases are −(x2 + y 2 ) (x2 − σ 2 ) 2σ 2 e , F (x, y; 0, σ) = 0.4607 σ4 −(x2 + y 2 ) π xy 2σ 2 F (x, y; , σ) = 0.4607 4 e , 3 σ 2 −(x + y 2 ) (y 2 − σ 2 ) 2π 2σ 2 F (x, y; , σ) = 0.4607 e , 3 σ4 and the `i s are given by the expressions: `1 (θ) = cos2 θ, `2 (θ) = − sin 2θ, and `3 (θ) = sin2 θ. π π We show the filter steered in directions θ = 0, , and radians in 4 2 Figure 1 (c)–(e), respectively. By steering the Gaussian second-order derivative in the direction θ∗ , we could extract ridges effectively as the convolution of the filter and the ridge gives maximum response in that direction, and leads to added noise robustness. 3.1. Choice of σ and window size Once the filter is steered in the ridge direction, masks for detecting ridges are generated by sampling the second-order Gaussian derivative on a uniform grid. The two parameters of the mask that affect

4.1. Results on clean images First, we considered an ophthalmic image and generated results with N = 9, σ = 1 and N = 15, σ = 2 using our method, and compared them with the second-order response obtained using the algorithm in [12] for feature width 2. These results are depicted in Figure 2. The exudates (lesions) detected using our method have similar shape as in the original image when we use a higher scale (N = 15, σ = 2), whereas they are slightly oversmoothed and smeared in case of the ridge detector in [12]. This aspect is made clear in the zoomed-in versions of the images highlighted in the second row of Figure 2. Next, we chose a zebra image, which presents ridges with larger scale in order to study the effect of choosing large σ values on the quality of detected features. We present the results of our method in this case with N = 35, σ = 7 and N = 29, σ = 5 followed by thresholding, and those resulting from the technique compared herein (fourth-order response with feature width 9) in Figure 3. We observe that the results obtained from the proposed method with large σ are better compared with the results of the ridge detector proposed in [12], which are oversmoothed. 4.2. Results on noisy images Presently, we consider the performance of the algorithms on noisy cryo-electron micrographs of DNA filaments. Ridge detection is carried out with N = 21, σ = 3 with and without non-maximal suppression, followed by hysteresis thresholding using the proposed method. The results are shown in Figure 4. We note that the detection results are improved, if we use the non-maximal suppression

3061

1A

Java plug-in is available at http://bigwww.epfl.ch.

(a) Fig. 2.

(b)

(c)

(d)

(a) Original image [16], (b) Proposed method with N/σ: 9/1, (c) N/σ: 15/2, and (d) Ridge detector in [12] (feature width: 2).

(a)

(b)

(c)

(a)

(b)

(c)

(d)

(d)

Fig. 3. (a) Original image [17], (b) Proposed method with N/σ: 35/7, (c) N/σ: 29/5, and (d) Ridge detector in [12] (feature width: 9).

block. Comparing with the benchmark algorithm (fourth-order response, feature width 2), we observe that the results of the detector in [12] are better in the sense that the detected ridges are at a finer scale. However, the results obtained using our technique exhibits lower background noise. 5. CONCLUSIONS We addressed the problem of ridge detection in images. A simple, two-step approach was developed for solving the feature extraction problem. The first step comprised computing the ridge orientations at all points using zerocrossings of the second directional derivative’s first derivative. The analytically computed orientation was found to depend on the image partial derivatives. Smooth estimates of the partial derivatives are obtained using LS polynomial fitting and resampling at the point of interest, the operation being equivalent to bandpass, linear, shift-invariant filtering referred to as Savitzky-Golay filtering. We noted that the filter coefficients can be pre-computed for a particular polynomial order and window size using standard LS procedures. This provided an efficient filtering solution to the prob-

Fig. 4. (a) Noisy micrograph [18], (b) Proposed method with N/σ: 21/3, (c) With non-maximal suppression, and (d) Ridge detector in [12] (feature width: 2). lem of smooth derivative estimation from discrete samples of a twodimensional function. Subsequent to estimating the ridge direction, we motivated the choice of a second-order Gaussian derivative filter as an approximation to the desired ridge filter template. The filter was then steered to the ridge orientations and convolved with the image to result in maximum responses at ridge points. The results of the ridge detection block were further improved using non-maximal suppression and hysteresis thresholding. The algorithm was tested on some test images, and the results obtained were compared with a performant method of ridge detection. The results were comparable with those obtained from the benchmark technique in most cases, with the proposed method giving marginally superior results in case of features with a larger scale and for ophthalmic images with lesions. Optimally choosing the σ parameter of the ridge filter, extending the method to higher dimensions, and studying the effect of S-G filters of different orders and window sizes [19] are further research directions.

3062

6. REFERENCES [1] A. Jain, L. Hong, and R. Bolle, “On-line fingerprint verification,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 19. no. 4, pp. 302–314, Apr. 1997. [2] Y. Li et al., “Ridge-branch-based blood vessel detection algorithm for multimodal retinal images,” in Proc. SPIE, vol. 7259, pp. 1–12, 2009. [3] M. Jacob, T. Blu, and M. Unser, “3D reconstruction of DNA filaments from stereo cryo-electron micrographs,” in Proc. IEEE Int. Symp. Biomedical Imaging: Macro to Nano, vol. 2, pp. 597–600, 2002. [4] J. M. Weiss, “Automatic detection of ship tracks in satellite imagery,” in Proc. IEEE Int. Conf. Geosci. and Remote Sensing (IGARSS ’97), vol. 1, pp. 160–162, Aug. 1997. [5] D. Eberly, R. Gardner, B. Morse, S. Pizer, and C. Scharlach, “Ridges for Image Analysis,” J. Math. Imaging and Vision, vol. 4, no. 4, pp. 353–373, Dec. 1994. [6] M. D. Saint-Venant, “Surfaces plus grande pente constitues sur des lignes courbes,” Bulletin de la soc. philomath. de Paris, pp. 24–30, Mar. 1852. [7] R. Haralick, “Ridges and valleys on digital images,” Comput. Vision, Graph., and Image Process., vol. 22, no. 10, pp. 28–38, Apr. 1983. [8] A. C. F. Colchester, “Network representation of 2D and 3D images,” in 3D Imaging in Medicine, K. H. Hoehne, H. Fuchs, and S. Pizer (eds.), Berlin, Germany: Springer-Verlag, 1990, pp. 45–62. [9] J. L. Crowley and A. C. Parker, “A representation for shape based on peaks and ridges in the difference of low pass transform,” IEEE Trans. Pattern Anal. and Mach. Intell., vol. 6, no. 2, pp. 156–170, 1984. [10] J. Gauch and S. Pizer, “Multiresolution analysis of ridges and valleys in grey-scale images,” IEEE Trans. Pattern Anal. and Mach. Intell., vol. 15, no. 6, pp. 635–646, June 1993. [11] W. T. Freeman and E. H. Adelson, “The design and use of steerable filters,” IEEE Trans. Pattern Anal. and Mach. Intell., vol. 13, no. 9, pp. 891–906, Sep. 1991. [12] M. Jacob and M. Unser, “Design of steerable filters for feature detection using Canny-like criteria,” IEEE Trans. Pattern Anal. and Mach. Intell., vol. 26, no. 8, pp. 1007–1019, Aug. 2004. [13] J. Canny, “A computational approach to edge detection,” IEEE Trans. Pattern Anal. and Mach. Intell., vol. 8, no. 6, pp. 679– 698, 1986. [14] A. Savitzky and M. J. E. Golay, “Smoothing and differentiation of data by simplified least squares procedures,” Anal. Chem., vol. 36, no. 8, pp. 1627–1639, July 1964. [15] R. W. Schafer, “What is a Savitzky-Golay filter?,” IEEE Signal Process. Mag., vol. 28, no. 4, pp. 111–117, July 2011. [16] http://www2.it.lut.fi/project/imageret/diaretdb1/. [17] http://wall.alphacoders.com/big.php?i=12931. [18] http://www.fidelitysystems.com/Unlinked DNA.html. [19] S. R. Krishnan and C. S. Seelamantula, “On the selection of optimum Savitzky-Golay filters,” IEEE Trans. Signal Process., vol. 61, no. 2, pp. 380–391, Jan. 2013.

3063