This page is a part of the Computer Vision Wiki. The wiki is devoted to computer vision, especially low level computer vision, digital image analysis, and applications. The exposition is geared towards software developers, especially beginners. The wiki contains discussions, mathematics, algorithms, code snippets, source code, and compiled software. Everybody is welcome to contribute with this in mind - all links are no-follow.

# Homology in 2D

### From Computer Vision Wiki

The homology groups of this image are vector spaces generated by these cycles, as follows. Consider first the image to the right. Its cycles are depicted below. Then the homology groups are the following.

H_{0} = **R**^{2}, the basis vectors are A and B.

H_{1} = **R**^{2}, the basis vectors are C and C’.

Thus, the dimension of the 0th or 1st homology group is equal to the 0th or 1st Betti number respectively. We do not describe yet how these vector spaces are constructed. The reason why we want to discuss them now and not just the Betti numbers is twofold. First, we want to emphasize that the cycles are not only counted but also captured. Second, as we shall see shortly, this approach allows us to perform algebraic operations with cycles.

Math Note. We use **R**^{k} for homology groups because we want to keep the prerequisites within an elementary linear algebra. Because of the nature of digital images, this will suffice. Using vector spaces over R is also a matter of convenience. In reality, the computations should be carried out in binary arithmetic, so that instead of **R**^{2}, the homology group would be **B**^{2}, where **B**={0,1}.

Images here...

Consider a different kind of example. Suppose we add some pixels to the image on the left to create the one on the right. Then the second image “includes” the first. What happens to the homology groups of the first image? Consider this pair.

During this procedure, which can be implemented by the method described in this chapter, the homology groups are transformed:

H_{0}=R^{1}→HR_{0}=H^{2},_{1}=R^{2}→ HR_{1}=^{1}.

To be able to describe how exactly, record what happens to the basis vectors: A → A, C → C, C’ → 0. Then, the transformations are simply two linear operators represented by the matrices:

L_{0 }= [1,0]^{T}: H_{0 }=R^{1}→ H_{0 }=R^{2}, L_{1 }= [1,0]: H_{1 }=R^{2}→H_{1 }=R^{1}.

Then we say that these operators are generated by the *inclusion* of the first image into the second.

A few examples of homology groups in 2D are in the table below:

B_{0}B_{1}homology

Letter O 1 1 **R**, **R**, 0

Two letters O 2 2 **R ^{2}**,

**R**,0

^{2}Letter B 1 2 **R ^{1}**,

**R**,0

^{2}

There will be more here...

Continue to Homology in 3D.