Crosssection topology Michel Couprie Contributors G Bertrand M
Cross-section topology Michel Couprie Contributors: • G. Bertrand • M. Couprie • J. C. Everat (Ph. D) • F. N. Bezerra (Ph. D)
Functions of 2 variables y x
On hills and dales [Cayley 1859, Maxwell 1870…]
BINARY IMAGES (SETS)
Topology preservation - notion of simple point • A topology-preserving transformation preserves the connected components of both X and X
Simple point Set X (black Simple Non-simple points) point of X • Definition (2 D): A point p is simple (for X) if its modification (addition to X, withdrawal from X) does not change the number of connected components of X and X
Simple point: local characterization ?
Simple point: local characterization ?
Connectivity numbers • T(p)=number of Connected Components of (X - {p}) N(p) where N(p)=8 -neighborhood of p • T(p)=number of Connected Components of (X - {p}) N(p) U U T=2, T=2 T=1, T=0 Interior point T=0, T=1 Isolated point • Characterization of simple points (local): p is simple iff T(p) = 1 and T(p) = 1
Homotopy • We say that X and Y are homotopic (they have the same topology) if Y may be obtained from X by sequential addition or deletion of simple points
Homotopy: illustration
GRAYSCALE IMAGES (FUNCTIONS)
Homotopy of functions • Basic idea: consider the topology of each crosssection (threshold) of a function • Given a function F (Z 2 Z) and k in Z, we define the cross-section Fk as the set of points p of Z 2 such that F(p) k • We say that two functions F and G are homotopic if, for every k in Z, Fk and Gk are homotopic (in the binary sense) [Beucher 1990…]
Homotopy of functions F(x, y) y G(x, y) x F 1 G 1 y x
Homotopy of functions F(x, y) y G(x, y) x F 2 G 2 F 1 G 1 y x
Homotopy of functions F(x, y) y G(x, y) x y x F 3 G 3 F 2 G 2 F 1 G 1
Destructible point [Bertrand 1997] • Definition: a point p is destructible (for F) if it is simple for Fk, with k = F(p) • Property: p is destructible iff its value may be lowered by one without changing the topology of any cross-section • Definition: a point p is constructible (for F) if it is destructible for -F (duality)
Destructible point: examples F(x, y) y x F 3 F 2 F 1
Destructible point: examples F(x, y) y x F 3 F 2 F 1
Destructible point: examples F(x, y) y x F 3 F 2 F 1
Destructible point: counter-examples F(x, y) Component deleted Component splitted y x F 3 F 2 Background component F 1 created
Destructible point: counter-examples F(x, y) Component deleted Component splitted y x F 3 F 2 Background component F 1 created
Connectivity numbers • N+(p) = {q in N(p), F(q) F(p)} • T+(p) = number of Conn. Comp. of N+(p). • N--(p) = {q in N(p), F(q) < F(p)} • T--(p) = number of Conn. Comp. of N--(p). • N++, T++, N-, T- : similar • If an adjacency relation (eg. 4) is chosen for T+, T++, then the other adjacency (8) must be used for T-, T--
Destructible point: local characterization • The point p is destructible if and only if : T+(p) = 1 and T--(p) = 1 1 2 1 9 5 1 9 9 9 1 2 8 9 5 8 9 1 1 1 2 1 1 5 1 2 2 1 T+ = 1 T-- = 1 T+ = 2 T-- = 2 T+ = 0 T-- = 1 destructible non-destructible
Classification of points [Bertrand 97] • The local configuration of a point p corresponds to exactly one of the eleven following cases: – peak (T+ = 0) – maximal destructible (T+ = T-- = 1, T++ = 0) – maximal divergent (T-- > 1, T++ = 0) – destructible convergent (T+ = T-- = 1, T++ > 1) – well (T- = 0) – minimal constructible (T++ = T- = 1, T-- = 0) – minimal convergent (T++ > 1, T-- = 0) – constructible divergent (T++ = T- = 1, T-- > 1) – interior (T++ = T-- = 0) – simple side (T+ = T-- = T++ = T- = 1) – saddle (T++ > 1, T-- > 1)
Classification of points: examples 1 2 1 9 5 1 9 9 9 1 2 8 9 5 8 9 1 1 5 5 5 5 5 Simple side Saddle Interior 1 2 1 1 5 1 2 2 1 1 2 1 9 9 1 1 2 2 9 9 9 1 1 2 1 9 5 9 Peak Maximal destructible Maximal divergent Destructible convergent
Grayscale skeletons • We say that G is a skeleton of F if G may be obtained from F by sequential lowering of destructible points • If G is a skeleton of F and if G contains no destructible point, then we say that G is an ultimate skeleton of F
Ultimate skeleton: 1 D example Regional minima
Ultimate skeleton: illustration
Ultimate skeleton: illustration
Ultimate skeleton: 2 D example Original image F Ultimate skeleton G of F Regional minima of F (white) Regional minima of G (white)
Thinness • In 1 D, the set of non-minimal points of an ultimate skeleton is « thin » (a set X is thin if it contains no interior point). Is it always true in 2 D ? • The answer is no, as shown by the following counter-examples.
Thinness 3 3 3 1 1 3 3 3 1 3 1 3 3 1 1 3 3 3 1 1 3 3 3 1 1 3 3 1 3 1 3 3 3 1 1 3 3 3 3 3 3 1 1 1 1 3 3 1 1 1 1 3 3 1 3 2 2 2 3 3 1 1 1 1 3 3 1 1 1 1 3 3 3 3 3
Thinness 3 3 3 3 2 2 2 1 3 3 2 2 1 2 3 3 2 1 2 2 3 3 1 2 2 2 3 3 3 3 3 1 1 1 1 3 3 1 1 1 3 3 3 2 3 1 3 2 2 2 3 1 1 3 3 1 3 2 2 2 3 1 1 3 3 3 2 3 1 3 3 1 1 1 3 3 1 1 1 1 3 3 3
Basic algorithm Basic ultimate grayscale thinning(F) Repeat until stability: Select a destructible point p for F F(p) : = F(p) – 1 Inefficient: O(n. g), where: n is the number of pixels g is the maximum gray level
Lowest is best The central point is destructible: 3 1 1 it can thus be lowered down to 5 9 6 1 without changing the topology. 9 9 9 It can obviously be lowered more: - down to 3 (since there is no value between 6 and 3 in the neighborhood) - down to 1 (we can check that once at level 3, the point is still destructible)
Two special values If p is destructible, we define: -(p)=highest value strictly lower than F(p) in the neighborhood of p -(p)=lowest value down to which F(p) can be lowered without changing the topology 3 1 1 9 6 1 9 9 9 Here: -(p)=3 (p)=1
Better but not yet good If we replace: F(p) : = F(p) – 1 in the basic algorithm by: F(p) : = (p), we get a faster algorithm. But its complexity is still bad. Let us show why:
Fast algorithm Fast ultimate grayscale thinning(F) Repeat until stability: Select a destructible point p for F of minimal graylevel F(p) : = (p) - Can be efficiently implemented thanks to a hierarchical queue - Execution time roughly proportional to n (number of pixels)
Complexity analysis: open problem 3 3 3 1 1 1 1 3 3 1 1 1 1 3 3 1 1 4 4 4 1 1 1 3 3 1 4 3 2 1 2 3 1 3 2 1 1 4 1 1 3 3 1 4 3 2 1 2 3 1 2 2 3 3 1 4 3 2 1 2 3 1 3 2 1 4 1 1 3 3 1 1 4 4 4 1 1 1 3 3 1 1 1 1 3 3 1 1 1 1 3 3 3
Non-homotopic operators • Topology preservation: strong restriction over segmentation • Our goal: Change topology in a controlled way regional minima segmented regions
Altering the topology • Control over topology modification. • Criteria: – Local contrast : notion of -skeleton – Regional contrast : regularization – Size : topological filtering – Topology : crestoration
-destructible point not -destructible Illustration (1 D profile of a 2 D image)
-destructible point • Definition: Let X be a set of points, we define F-(X)=min{F(p), p in X} Let be a positive integer A destructible point p is -destructible A k-divergent point p is -destructible if at least k-1 connected components ci (i=1, …, k-1) of N--(p) are such that F(p) - F(ci)
-skeleton : examples =0 = 15 = 30
Topological filtering A: original B: thinning+ peak deletion C: reconstruction of B under A
Topological filtering (cont. ) Original image
Topological filtering (cont. ) Homotopic thinning (n steps)
Topological filtering (cont. ) Peak deletion
Topological filtering (cont. ) Homotopic reconstruction
Topological filtering (cont. ) Final result
Topological filtering (cont. ) Comparison with other approaches (median filter, morphological filters) : better preservation of thin and elongated features
Crestoration • Motivation Original image Gradient Thinning + thresholding
Crestoration (cont. ) 0 0 60 240 50 50 50 240 240 50 50 0 60 40 240 50 50 50 60 40 40 90 50 50 50 0 60 40 90 50 50 50 0 0 90 50 50 50 0 0 0 240 50 50 50 0 90 50 50 50 240 240 50 50 • p is a separating point if – there is k such that T(p, Fk)=2 • p is extensible if – p is a separating point, and – p is a constructible or saddle point, and – there is a point q in its neighborhood that is an end point or an isolated point for Fk, with k=F(p)+1
Crestoration (cont. ) 0 0 60 240 50 50 50 240 240 50 50 0 60 40 240 50 50 50 60 40 40 90 50 50 50 0 60 40 90 50 50 50 0 0 90 50 50 50 0 0 0 240 50 50 50 0 90 50 50 50 240 240 50 50 • p is a separating point if – there is k such that T(p, Fk)=2 • p is extensible if – p is a separating point, and – p is a constructible or saddle point, and – there is a point q in its neighborhood that is an end point or an isolated point for Fk, with k=F(p)+1
Crestoration (cont. ) 0 0 0 240 240 240 50 50 0 60 240 50 50 50 0 0 0 240 240 50 50 0 60 240 50 50 50 0 60 40 240 50 50 50 60 40 40 240 50 50 50 0 60 40 90 50 50 50 0 60 40240 50 50 50 0 0 90 50 50 50 0 90 50 50 0 240 50 50 50 0 60 40 240 50 50 50 0 240 50 50 50 0 0 0 240 50 50 50 0 0 240 50 50 50 0 0 0 0 240 50 50 50 0 240 50 50 50 0 0 240 240 240 50 50
Crest Restoration: result ‘Significant’ crests have been highlighted (in green) Before crestoration: After crestoration:
Crestoration (cont. ) Thinning + thresholding Gradient Thinning + crestoration + thresholding
Crestoration (cont. ) Thinning+ hysteresis thresholding (2 parameters) Thinning + crestoration + thresholding (1 parameter)
Conclusion • Strict preservation of both topological and grayscale information • Combining topology-preserving and topology-altering operators • Control based on several criteria (contrast, size, topology)
Perspectives • Study of complexity • Extension to 3 D • Topology in orders (G. Bertrand)
References • G. Bertrand, J. C. Everat and M. Couprie: "Image segmentation through operators based upon topology", Journal of Electronic Imaging, Vol. 6, No. 4, pp. 395 -405, 1997. • M. Couprie, F. N. Bezerra, Gilles Bertrand: "Topological operators for grayscale image processing", Journal of Electronic Imaging, Vol. 10, No. 4, pp. 1003 -1015, 2001. • www. esiee. fr/~coupriem/Sdi/publis. html
- Slides: 63