![Page 1: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/1.jpg)
Introduction to Digital and ComputationalTopology
Lidija Comic
University of Novi Sad, Serbia
July 14, 2017
![Page 2: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/2.jpg)
2D Square Grid
Ordered pairs p = (i , j) ∈ Z2, points or squares, with adjacencyrelation α defined based on coordinates.
I Adjacency α is symmetric.
I An α-path is a sequence of pixels, any two consecutive pixelsare α-adjacent.
I A subset S of the grid is α-connected if there is an α-path inS connecting every two pixels of S .
I A connected component of S is a maximal connected subset.
An image is a rectangular subset of the grid, with values P(p)assigned to pixels.All notions generalize to 3D.
![Page 3: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/3.jpg)
Topological ”Problem”
Jordan curve theorem in R2: Every simple closed curve in the planeseparates the plane in two disjoint open connected components.One of them is bounded, the other is unbounded.
![Page 4: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/4.jpg)
Topological ”Problem”
In the square grid, a simple closed α-curve is a finite α-connectedset of at least t pixels in which each pixel is α-adjacent to exactlytwo other pixels in the set (t = 8, 4 for α = 4, 8).
Do these curves separate the digital plane if α = 8 and if α = 4?
![Page 5: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/5.jpg)
Solution
I A simple closed α-curve separates the grid in two disjoint(12− α)-connected components.
Different adjacency α is used for object and background pixels.
![Page 6: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/6.jpg)
Connected Component Labeling
Connectedness is an important topological property of a set.What are the connected components?
![Page 7: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/7.jpg)
Connected Component Labeling: Region-Growing
Scan image until a non-labeled pixel p (with given P(p)) is found.
1. Label p with new label L(p), put p in stack.
2. If the stack is empty, stop.
3. Pop r out of stack.
4. Label with L(r) all non-labeled pixels q α-adjacent to r withP(q) = P(r), put them in stack.
5. Go to Step 2.
Repeat until all pixels are visited.
![Page 8: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/8.jpg)
Exercise
In what order will the pixels be visited by the algorithm, if for eachcurrent pixel the order is clockwise starting from left?
Choose 4- (8)-adjacency for black (white) pixels.
![Page 9: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/9.jpg)
Betti Numbers and Euler Characteristic
In 2D:
I β0 - number of connected components
I β1 - number of holes (connected components of thebackground, not counting the infinite background component)
I χ = β0 − β1
![Page 10: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/10.jpg)
Betti Numbers and Euler Characteristic
In 2D:
I β0 - number of connected components
I β1 - number of holes (connected components of thebackground, excluding the ’infinite’ background component)
I χ = β0 − β1
![Page 11: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/11.jpg)
Betti Numbers and Euler Characteristic
In 2D:
I β0 - number of connected components
I β1 - number of holes (connected components of thebackground, excluding the ’infinite’ background component)
I χ = β0 − β1
![Page 12: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/12.jpg)
Betti Numbers and Euler Characteristic
In 2D:
I β0 - number of connected components
I β1 - number of holes (connected components of thebackground, excluding the ’infinite’ background component)
I χ = β0 − β1
![Page 13: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/13.jpg)
Betti Numbers and Euler Characteristic
In 2D:
I β0 - number of connected components
I β1 - number of holes (connected components of thebackground, excluding the ’infinite’ background component)
I χ = β0 − β1
![Page 14: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/14.jpg)
Betti Numbers and Euler Characteristic
In 3D:
I β0 - number of connected components
I β1 - number of tunnels (difficult to define and count)
I β2 - number of voids (connected components of thebackground, excluding the ’infinite’ background component)
I χ = β0 − β1 + β2
![Page 15: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/15.jpg)
An alternative view of the discrete 2D grid
Consider also edges and vertices of squares (pixels) in thetessellation of the plane.
Cell complex Γ =m⋃
k=0
Γk
I finite set of cells (homeomorphic images of discs)
I cell interiors are disjoint
I boundary of each cell is a union of cells of lower dimension
I intersection of any two cells is composed of cells of lowerdimension
χ(Γ) = |Γ0| − |Γ1|+ ...+ (−1)m|Γm|I χ(Γ) = v − e + f if m = 2
I χ(Γ) = v − e + f − c if m = 3.
Thus, β1 can be easily computed in 3D as β0 + β2 − χ(Γ).
![Page 16: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/16.jpg)
Example
Euler-Poincare formula in 2D: v − e + f = β0 − β1.
3
f
edc
ba
6
1 2
g4 5
A
v = 6, e = 7, f = 1 β0 = 1, β1 = 1.
![Page 17: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/17.jpg)
Homology Generators
Boundary matrix ∂k :
I columns are labeled by k-cells
I rows are labeled by (k − 1)-cells
I matrix element is 1 (0) if the (k − 1)-cell is (not) in theboundary of the k-cell
Take ∂k to the reduced form (1’s at the beginning of the maindiagonal, 0’s elsewhere):
I exchange two rows (columns)
I add mod 2 one row (column) to another
![Page 18: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/18.jpg)
Homology Generators
I number of zero columns = number of k-cycles zkI number of non-zero rows = number of (k − 1)-boundaries
bk−1
I βk = zk − bk
Do the same operations on row/column labels.
I labels of zero columns are cycles
I labels of non-zero rows are boundaries
Cycles that are not boundaries are homology generators.
![Page 19: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/19.jpg)
Example
3
f
edc
ba
6
1 2
g4 5
A
![Page 20: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/20.jpg)
Simple Voxel Characterization
A voxel v in a set S is 26-simple if
I there is exactly one 26-connected component of 1’s in its26-neighborhood, and
I there is exactly one 6-connected component of 0’s 6-adjacentto v in its 18-neighborhood
![Page 21: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/21.jpg)
Simple Voxel Characterization
In the cell complex model, a voxel v in a set S is 26-simple if
I its attachment set Attach(v) is non-empty and connected, and
I the complement of the set Attach(v) in the boundary of v isnon-empty and connected
The attachment set Attach(v) of v is the intersection of theboundary of v and of the boundary of S − {v}.
![Page 22: Introduction to Digital and Computational Topologyimft.ftn.uns.ac.rs/ssip2017/wp-content/uploads/2016/12/beamer.pdf · 2D Square Grid Ordered pairs p = (i;j) 2Z2, points or squares,](https://reader033.vdocuments.pub/reader033/viewer/2022060418/5f15794ec8da040f414cbad5/html5/thumbnails/22.jpg)
Conclusion
Digital and computational topology is
I interesting
I fun
I useful
Questions?