[B,L,N,A] = BWBOUNDARIES(...) returns the number of objects found (N) and an adjacency matrix A. The first N cells in B are object boundaries. A represents the parent-child-hole dependencies. A is a square, sparse, logical matrix with side of length max(L(:)), whose rows and columns correspond to the position of boundaries stored in B. The boundaries enclosed by a B{m} as well as the boundary enclosing B{m} can both be found using A as follows