Computer Vision Primer: beginner's guide to methods of image analysis, data analysis, and related math, image analysis software, applications in sciences and engineering.
Betti numbers
From Computer Vision Primer
Betti numbers represent the count of the number of topological features - in digital images, cell complexes, or topological spaces.
For example, in the first image on the right the number of objects is 6, so the 0th Betti number b0 is 6. The number of holes is 2, so the 1st Betti number b1 is 2 as well.
More generally, the 0-, 1-, and 2-dimensional topological features are:
- objects or connected components – dimension 0,
- holes or tunnels – dimension 1, and
- voids or cavities – dimension 2.
One might go on if we study the topology of datasets.
The number of these features in each dimension is captured by the corresponding Betti number: b0, b1, and b2. Examples are in the table below.
|
b0 (parts) |
b1 (holes) |
b2 (voids) | |
|
Letter O |
1 |
1 |
0 |
|
Two letters O |
2 |
2 |
0 |
|
Letter B |
1 |
2 |
0 |
|
Donut |
1 |
1 |
0 |
|
Tire |
1 |
2 |
1 |
|
Ball |
1 |
0 |
1 |
If the geometric figure X has to be specified, we use bk(X).
In practice, i.e., computer vision and image analysis, you can't count topological features by looking from the "outside". Instead you count "cycles" that capture these features. Counting 0-cycles and 1-cycles in 2D is fairly simple (besides there are ways to solve the problem without using cycles, see Image analysis examples).
Let's now consider 1-cycles, i.e., circular curves, in 3D. In the torus, there are two kinds of cycles: the latitudes (one is red) and the longitudes (one is blue). The latitudes capture the tunnel inside the tire while the longitudes capture the tunnel through the tire.
Clearly there are many cycles that capture the same topological feature. So, how do you avoid overcounting them? The answer is: if two cycles are homologous to each other, they are counted as one (see Homology as an equivalence relation).
One way to explain homology is this. Two 1-cycles are homologous if they together form the boundary of a surface.
For example, any latitude is homologous to the red cycle because they are the two ends of a tube cut from the tire. Any longitude is homologous to the blue cycle because they are the two edges of a strip cut from the tire. This is why b1 = 2.
In the sphere the blue cycle is homologous to a point, a trivial cycle, that's why b1 = 0. Another way to see that it is trivial is to imagine how it can contracted to a point like a rubber band. The same thing happens with the donut.
Betti numbers are combined together (as the alternating sum) to produce the well-known Euler number (aka Euler characteristics).
Continue to Topological Features of Images.
One can see that many very practical image analysis examples are simply about counting, i.e., Betti numbers.
