Ask Your Question

Revision history [back]

Opencv has a cool tool called lineIterator

For each point, create a line (using line iterator) to all the other points. Step along the line and look at pixel values. If all the values are dark/black, then this is a potential edge. If 2 or more potential edges start at the same point and have the same direction (dot product), only add the shortest one (L2 norm) to the adj matrix.