HAP home

20. Topological Data Analysis

ReadImageFile("file.png",n)

Inputs an image file ("file.png", "file.eps", "file.bmp" etc) and an integer n between 0 and 765. It returns a 1/0 integer matrix representing a black/white version of the image determined by the threshold n.

BettiNumbersOfMatrix(A)

Inputs a 1/0 integer matrix A representing a black/white version of an image. It returns a list [b0,b1] where b0 is the zeroth betti number of the black image space, and b1 is the first betti number. All higher betti numbers will be zero as the space is 2-dimensional.

MatrixToChainComplex(A)

Inputs a 1/0 integer matrix A representing a black/white version of an image and returns the cellular chain complex of the black image space (in characteristic 0).

ContractMatrix(A)

Inputs a 1/0 integer matrix A representing a black/white version of an image and modifies A so that it represents a homotopy equivalent image space hopefully with fewer black cells. Black cells are removed from the image to produce a homotopy equivalent image from which no further black cell can be removed without changing the homotopy type. The function returns true if it succeeds in reducing the number of cells of the original image; otherwise it returns false.

ThickenedMatrix(A) ThickenedMatrix(A,n)

Inputs a 1/0 integer matrix A and returns a 1/0 matrix B. If an entry in A is equal to 1 then the corresponding entry in B and all eight neighbouring entries in B are equal to 1.

If a positive integer n is input as a second argument then the thickening process is repeated n times.


 





generated by GAPDoc2HTML