What you ask for is an unsolvable problem, because it depends on the embedding of the graph in the plane (or space). Consider the following graphs:
They are isomorphic, and described by the same node-edge incidence matrix, but you want different answers for them.
You need to specify a planar embedding (i.e., coordinates for the vertices) for this to work.