Abstract
Minimal path extraction is a frequently used tool in image processing with applications in for example centerline extraction and edge tracking. This paper presents results and methods for (i) extracting minimal paths and for (ii) utilizing local direction in the minimal path computation. Minimal path extraction is based on sum of distance transforms resulting in a stable method, without need for local decisions, which is needed for methods based on backtracking. Local direction utilization is discrete derivative based concepts such as the structure tensor, the Hessian and the Beltrami framework. The combination of minimal path extraction and local direction utilization gives a strong framework for minimal path extraction.
You have full access to this open access chapter, Download conference paper PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
1 Introduction
Many image processing and analysis applications use distance transforms [1, 3, 23, 25, 30, 31]. By taking the pixel intensity values into consideration, the homogeneous regions can be extracted [5, 6, 25, 26]. Not only pixel intensity values, but also other high-level features, based on for example pointwise texture features or local direction, can be utilized. Minimal path is a frequently used tool for, e.g., centerline or boundary extraction. One approach for minimal path extraction is based on backtracking the distance transform values from a given point to the closest seed point by steepest descent [15, 33]. A limitation with this approach is that it is based on local decisions, which, in general, does not give unique solutions. This manuscript presents an alternative approach based on sum of distance transforms for finding minimal paths. This approach has been used in mathematical morphology [27, 28], level-set based distance computation [13] and for a specific family of geodesic distance functions [10]. Here, we show that this approach is valid for a family of distance functions, including for example the fuzzy distance [6, 25, 27] and the geodesic distance [6, 32]. In Sect. 4, the approach presented in Sect. 3 is applied to minimal path formulations that utilize prior knowledge on the prefered direction at each point.
2 Notation
Given some cost function \(C:\pi _{p,q} \mapsto \mathbb {R}\), where p, q are points in a digital image and \(\pi _{p,q}\) is a path between p and q, the minimal path between two points p and q is \(\arg \min _{\pi \in \varPi _{p,q}} C(\pi )\), where \(\varPi _{p,q}\) is the set of all paths between p and q. The cost of the minimal cost path between p and q is \({C}_{\text {opt}}(p,q)=\min _{\pi \in \varPi _{p,q}} C(\pi )\).
Definition 1
A path \(\pi =\langle p=p_0, p_1, \dots , p_n=q \rangle \) from p to q is a minimal path if there is no other path between p and q with lower cost/distance.
A function d such that, for all x, y, z in its domain is a metric if
-
1.
\(d(x,x)= 0\) (identity)
-
2.
\(d(x,y) > 0 \) for all \( x\ne y\) (positivity)
-
3.
\(d(x,y)=d(y,x)\) (symmetry)
-
4.
\(d(x,z)\le d(x,y)+d(y,z)\) (triangle inequality)
A distance transform from a single source point p is denoted \(DT_p\) and
Intensity-weighted distance functions can be used to model some intuitive, expected distance in the image, such that the obtained minimal paths are optimal on dark or bright regions in the image, or at strong edges in the image and higher-level features can be used to extract minimal paths on a centerline or boundary of an object. Distance transforms utilizing higher-order features can for example be obtained by pre-filtering the image by, e.g., an edge detector or a “vesselness” filter [19], before using the distance functions below. Other approaches, where the prior information is incorporated in the distance function, will be given in Sect. 4.
3 Minimal Paths as Minima in the Sum of Distance Transforms
Minimal cost paths can be computed by an assumption that the minimal cost path between two points p and q is in the set of minima in \(DT_{pq}(x)= DT_p(x)+DT_q(x)\) [10, 13, 27, 28].
The results in this section are valid for distance functions such that all metricity properties fulfilled, except that the strict positivity is replaced by non-negativity, and the following property holds.
Property 1
For any minimal path \(\langle p=p_0 , p_1 , \dots , p_n=q \rangle \), it holds that
Examples of distance functions that fulfill Property 1 are
-
The fuzzy distance [6, 25, 27]. The fuzzy distance is the minimal cost path when the cost between two adjacent points is
$$c(p,q)= \frac{f(p)+f(q)}{2}\cdot \Vert p-q \Vert ,$$where f(p) is the intensity value at pixel p.
-
The geodesic distance [6, 32]. The geodesic distance is the minimal cost path when the cost between two adjacent points is
$$c(p,q)= \omega \left| f(p)-f(q)\right| + \Vert p-q \Vert . $$The parameter \(\omega \) affects trade-off between the fuzzy membership values and the Euclidean distance.
In Theorem 1, we prove that the minimal path between two points is in the set of minimum of sum distance transforms from the points. For the proof we will use Lemmas 1 and 2, both related to the property that line segments between two given points contain points of the shortest path between the points [12, 20].
Lemma 1
Let \(M=\{ x : d(p,q)=d(p,x)+d(x,q) \}\) and \(R=\left\{ x:DT_{pq}(x)= \min _x DT_{pq}(x) \right\} \). Then \(M=R\).
Proof
This is a direct consequence of the triangle inequality: For any point r, \(d(p,q)\le d(p,r)+d(r,q)\). If \(r\notin M\), then \(DT_{pq}(r)=DT_p(r)+DT_q(r)=d(p,r)+d(r,q)>d(p,q) = \min _x DT_{pq}(x)\). If \(r\in M\), then \(DT_{pq}(r)=DT_p(r)+DT_q(r)=d(p,r)+d(r,q)=d(p,q) = \min _x DT_{pq}(x)\). \(\square \)
Lemma 2
If \(x\in M=\{ x : d(p,q)=d(p,x)+d(x,q) \}\), then x is in a minimal path between two points p and q.

Proof
If \(d(p,q)=d(p,x)+d(x,q)\), then the path \(\pi =\langle p=p_0, p_1, \dots , p_m =x \rangle \cdot \langle x=q_0, q_1, \dots , q_n =q \rangle \) is minimal, since its cost is \(d(p,x)+d(x,q)=d(p,q)\), which is optimal by the triangular inequality. \(\square \)
Theorem 1
Given a (pseudo)-metric such that Property 1 is fulfilled, the points in minimal paths between p and q are contained in the set
where \(DT_{pq}(x)=DT_p(x)+DT_q(x)\).
Proof
The theorem follows directly from Lemmas 1 and 2. \(\square \)
Theorem 1 can be applied by Algorithm 1. Examples of realizations of Algorithm 1 are shown in Fig. 1.
4 Minimal Paths with Relative Position Prior
A common approach for extracting vessels and tubular structures is to use a so-called vesselness filter [4, 7], which is based on the Hessian matrix, i.e., second derivatives of the intensity values in the image data.
4.1 Minimal Paths by Prefiltering the Input Image
Given a window, or smoothing, function W, the structure tensor S is obtained by integrating the outer product of the gradient \(\nabla f = [f_x f_y]\) with itself over a region given by a window function:
where \(*\) is convolution and W is some window function or a Gaussian. Note that the derivatives should be derived using an appropriate discrete operator [9, 34]. The structure tensor, which captures information on the predominant directions of the gradient vector field in a specified neighborhood of a point, and its variations, has been widely used for enhancing local structure and direction [2, 14, 18]. Let \(\lambda _1\) be the largest eigenvalue of S and \(\lambda _2\) the smallest eigenvalue. Then
-
The derivative is close to zero in all directions in constant areas (\(|\lambda _1| \approx |\lambda _2| \approx ~0\)),
-
there is a dominant direction with a strong gradient magnitude at edges (\(|\lambda _1| \gg |\lambda _2| \approx 0\)) and
-
the derivative is strong also in the orthogonal directon at corners, so \(|\lambda _1| \approx |\lambda _2| \gg 0\).
The structure tensor is based on the first derivative and is therefore not ideal for tubular structures since both \(f_x\) and \(f_y\) are close to zero at the center of a tubular structure. For tubular structures, the second derivative has properties that can be utilized since we can expect low intensity variation along the tubular structure and a local max/min in the perpendicular direction, i.e., a high second derivative.
To enhance tubular structures, the Hessian
which is based on second derivatives, is a good choice. Again, let \(\lambda _1\) be the largest eigenvalue and \(\lambda _2\) the smallest eigenvalue. Now,
-
\(\lambda _1 \approx \lambda _2 \approx 0\) in constant areas,
-
\(|\lambda _1| \gg |\lambda _2| \approx 0\) at tubular structures and
-
\(\lambda _1 \approx \lambda _2\) and \(|\lambda _2| \gg 0\) for blob-like structures.
Based on this, different measures of “vesselness” and “blobness” have been proposed [8, 16, 17].
4.2 Minimal Paths by Prior Knowledge on Prefered Directions
The local “direction” in the image can be extracted in many ways, for example by the Hessian or structure tensor as in Sect. 4.1 and the prefered local direction can be based on measures on local features corresponding to, e.g., vessels, blobs, edges or corners. The resulting preferred local directions can be represented by a vector field, which, in turn can be used to guide the path cost function. In this section, we will explain how the local direction can be used for guiding the minimal path extraction by including information based on the gradient in the definition of the grey-weighted distance function.
Minimal Paths Guided by the Gradient
Metrics can be defined on the topographic representation of the image intensity function f, or rather, on the graph of f defined as \(\varphi (x,y)\rightarrow (x,y, f(x,y))\). If the metric is a (pseudo-) Riemannian metric expressed as a metric tensor g on the graph of f, then the metric can be pulled back to the image plane by the Beltrami framework, [11]. The pullback metric is given by \(J^T g J\), where J is the Jacobian of \(\varphi \), i.e.,
Following the Beltrami framework, the distance (pullback metric) between two points p and \(q=p+u\) is given by
where
If we set
we get the geodesic path length on the surface. Similar to the geodesic distance, a topographic representation of the image is considered, where the intensity values correspond to the height.
Also similar to the geodesic distance, we can set a parameter that gives the trade-off between the intensity range and the spatial distance between x and y;
corresponds to scaling of f with \(\alpha \), leading to the following following effect on B:
This idea has also been generalized by using the structure tensor instead of the outer product of gradients, i.e., exchanging B for
where \(G_{\sigma }\) is a Gaussian function with standard deviation \(\sigma \) [18]. This is a generalization since the standard Beltrami pullback metric is achieved by setting \(\sigma =0\) and the generalization extends the Beltrami framework to penalize both image gradients (edges) and ridges (lines) by the structure tensor [18].
Note that this general framework allows other (pseudo-) metrics to be used and pulled back to the image plane. For example,
gives a pseudo-metric that does not take spatial distance in the image plane into account. This idea has been used for edge detection in color images [24].
4.3 General Metric Tensor Minimal Path-Cost
By combining path costs given by the intensity values in the image, as given in Eq. 2, with the cost given by the local direction, a more general path cost framework is obtained by using a path cost functions on the form
where E is an appropriate combination of a grey-weighted path cost function \(c_{\text {intensity}}\) and a tensor-based path cost function \(c_{\text {tensor}}\) that takes local direction into account.
The tensor-based path cost function \(c_{\text {tensor}}\) is defined by a metric tensor M(p) i.e.,
where M(p) typically is restricted to symmetric and positive definite matrices. The positive definiteness is sometimes relaxed to non-negativity and sometimes M(p) is restricted to diagonal matrices [22].
Example 1. Circular paths, for example, annual rings in log ends, can be extracted by utilizing the polar geometry of the paths [21, 29]. By matrix diagonalization, we can define a tensor field where eigenvalues and eigenvectors are given by P and D:
where
and r and \(\theta \) are polar coordinate representation of p.
A path cost function based on multiplicative weighting of image intensity differences and spatial distance in polar coordinates can be defined by
with M(p) as given in Eq. 4. An example of distance transforms and a minimal path using this path-cost function is shown in Fig. 2. By applying a standard Taylor expansion of \((p-(p+v))' P D P^{-1} (p-(p+v))\), P and D are as in Eq. 5 and
we get
where \(R_2(\varDelta r,\varDelta \theta )\) is the remainder term (a weighted sum of monomials of degrees higher than 2). This leads to a special case of the path cost function used in [21] for extracting circular paths:
where \(\varDelta r(p,v)=|r_p - r_{p+v} |\) and \(\varDelta \theta (p,v)=\min \left( |\theta _p - \theta _{p+v}| , 2\pi -|\theta _p - \theta _{p+v}| \right) \).
Distance transform in polar coordinates on a constant intensity input image by the general metric tensor and minimal path extraction. (a): Visualization of the tensor field. (b): The sum of distance transforms from two source points on equal distance from the center of the image using polar weights. (c): The set containing the minimal path by Algorithm 1.
5 Conclusion
Results on minimal path extraction for path-based distance functions have been presented together with results on path cost functions that utilizes local direction. This combination gives a general and practically useful framework for minimal path extraction with many potential applications based on for example, centerline extraction and edge tracking.
References
Borgefors, G.: On digital distance transforms in three dimensions. Comput. Vis. Image Underst. 64(3), 368–376 (1996)
Budde, M.D., Frank, J.A.: Examining brain microstructure using structure tensor analysis of histological sections. NeuroImage 63(1), 1–10 (2012)
Danielsson, P.E.: Euclidean distance mapping. Comput. Graph. Image Process. 14, 227–248 (1980)
Dufour, A., Tankyevych, O., Naegel, B., Talbot, H., Ronse, C., Baruthio, J., Dokládal, P., Passat, N.: Filtering and segmentation of 3D angiographic data: advances based on mathematical morphology. Med. Image Anal. 17(2), 147–164 (2013)
Falcão, A.X., Stolfi, J., de Alencar Lotufo, R., Lotufo, R.A.: The image foresting transform: theory, algorithms, and applications. IEEE Trans. Pattern Anal. Mach. Intell. 26(1), 19–29 (2004)
Fouard, C., Gedda, M.: An objective comparison between gray weighted distance transforms and weighted distance transforms on curved spaces. In: Kuba, A., Nyúl, L.G., Palágyi, K. (eds.) DGCI 2006. LNCS, vol. 4245, pp. 259–270. Springer, Heidelberg (2006)
Frangi, A., Niessen, W., Hoogeveen, R., Van Walsum, T., Viergever, M.: Model-based quantitation of 3-d magnetic resonance angiographic images. IEEE Trans. Med. Imaging 18(10), 946–956 (1999)
Frangi, A.F., Niessen, W.J., Vincken, K.L., Viergever, M.A.: Multiscale vessel enhancement filtering. In: Wells, W.M., Colchester, A.C.F., Delp, S.L. (eds.) MICCAI 1998. LNCS, vol. 1496, pp. 130–137. Springer, Heidelberg (1998)
Grady, L.J., Polimeni, J.R.: Discrete Calculus, Applied Analysis on Graphs for Computational Science. Springer, London (2010)
Ikonen, L., Toivanen, P.: Shortest routes on varying height surfaces using grey-level distance transforms. Image Vis. Comput. 23(2), 133–141 (2005)
Iwaniec, T., Martin, G.: The beltrami equation. Mem. Am. Math. Soc. 191, 893 (2008)
Kim, C.E., Rosenfeld, A.: Digital straight lines and convexity of digital regions. IEEE Trans. Pattern Anal. Mach. Intell. 4(2), 149–153 (1982)
Kimmel, R., Amir, A., Bruckstein, A.M.: Finding shortest paths on surfaces using level sets propagation. IEEE Trans. Pattern Anal. Mach. Intell. 17(6), 635–640 (1995)
Knutsson, H.: Representing local structure using tensors. In: The 6th Scandinavian Conference on Image Analysis, pp. 244–251, Oulu, Finland, June 1989
Lengyel, J., Reichert, M., Donald, B.R., Greenberg, D.P.: Real-time robot motion planning using rasterizing computer graphics hardware, vol. 24. ACM (1990)
Lindeberg, T.: Edge detection and ridge detection with automatic scale selection. In: IEEE Proceedings of the Computer Vision and Pattern Recognition, CVPR 1996, pp. 465–470 (1996)
Lorenz, C., Carlsen, I.C., Buzug, T., Fassnacht, C., Weese, J.: Multi-scale line segmentation with automatic estimation of width, contrast and tangential direction in 2D and 3D medical images. In: Troccaz, J., Mösges, R., Grimson, W.E.L. (eds.) CVRMed-MRCAS 1997, CVRMed 1997, and MRCAS 1997. LNCS, vol. 1205, pp. 233–242. Springer, Heidelberg (1997)
Malm, P., Brun, A.: Closing curves with riemannian dilation: application to segmentation in automated cervical cancer screening. In: Bebis, G., Boyle, R., Parvin, B., Koracin, D., Kuno, Y., Wang, J., Wang, J.-X., Wang, J., Pajarola, R., Lindstrom, P., Hinkenjann, A., Encarnação, M.L., Silva, C.T., Coming, D. (eds.) ISVC 2009, Part I. LNCS, vol. 5875, pp. 337–346. Springer, Heidelberg (2009)
Manniesing, R., Viergever, M.A., Niessen, W.J.: Vessel enhancing diffusion: a scale space representation of vessel structures. Med. Image Anal. 10(6), 815–825 (2006)
Nagy, B., Orosz, A.: Simple digital objects on \(Z^2\). In: 7th International Conference on Applied Informatics, ICAI 2007, Eger, Hungary, vol. I, pp. 139–146 (2007)
Norell, K., Lindblad, J., Svensson, S.: Grey weighted polar distance transform for outlining circular and approximately circular objects. In: 14th International Conference on Image Analysis and Processing, pp. 647–652 (2007)
Ramanan, D., Baker, S.: Local distance functions: a taxonomy, new algorithms, and an evaluation. IEEE Trans. Pattern Anal. Mach. Intell. 33(4), 794–806 (2011)
Rosenfeld, A., Pfaltz, J.L.: Distance functions on digital pictures. Pattern Recogn. 1, 33–61 (1968)
Rousseau, S., Helbert, D., Carre, P., Blanc-Talon, J.: Metric tensor for multicomponent edge detection. In: 17th IEEE International Conference on Image Processing. pp. 1953–1956 (2010)
Saha, P.K., Wehrli, F.W., Gomberg, B.R.: Fuzzy distance transform: theory, algorithms, and applications. Comput. Vis. Image Underst. 86, 171–190 (2002)
Sethian, J.A.: Level Set Methods and Fast Marching Methods. Cambridge University Press, Cambridge (1999)
Soille, P.: Generalized geodesy via geodesic time. Pattern Recogn. Lett. 15(12), 1235–1240 (1994)
Soille, P.: Morphological image analysis: principles and applications. In: ter Haar Romeny, B.M. (ed.) Geometry-Driven Diffusion in Computer Vision, pp. 229–254. Springer, Heidelberg (2013)
Strand, R., Norell, K.: The polar distance transform by fast-marching. In: 19th International Conference on Pattern Recognition, pp. 1–4 (2008)
Strand, R., Ciesielski, K.C., Malmberg, F., Saha, P.K.: The minimum barrier distance. Comput. Vis. Image Underst. 117(4), 429–437 (2013). special issue on Discrete Geometry for Computer Imagery
Strand, R., Nagy, B., Borgefors, G.: Digital distance functions on three-dimensional grids. Theor. Comput. Sci. 15(412), 1350–1363 (2011)
Toivanen, P.: New geodesic distance transforms for grey-scale images. Pattern Recogn. Lett. 17, 437–450 (1996)
Verbeek, P., Dorst, L., Verwer, B.J., Groen, F.C.: Collision avoidance and path finding through constrained distance transformation in robot state space. In: Proceedings of Intelligent Autonomous Systems, pp. 634–641. Elsevier, Amsterdam (1986)
Zenzo, S.D.: A note on the gradient of a multi-image. Comput. Vis. Graph. Image Process. 33(1), 116–125 (1986)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this paper
Cite this paper
Strand, R. (2016). Minimal Paths by Sum of Distance Transforms. In: Normand, N., Guédon, J., Autrusseau, F. (eds) Discrete Geometry for Computer Imagery. DGCI 2016. Lecture Notes in Computer Science(), vol 9647. Springer, Cham. https://doi.org/10.1007/978-3-319-32360-2_27
Download citation
DOI: https://doi.org/10.1007/978-3-319-32360-2_27
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-32359-6
Online ISBN: 978-3-319-32360-2
eBook Packages: Computer ScienceComputer Science (R0)