IMAGEGRAPH Create equivalent graph of a binary image. [N E] = imageGraph(IMG); or [N E F] = imageGraph(IMG); create graph representing adjacencies in image. N is the array of nodes, E is the array of edges, and F is a 4-columns array containing indices of vertices of each face. IMG can be either 2D or 3D image. This functions uses only 4 neighbors in 2D, and 6 neighbors in 3D.
Package: matgeom