Segmenting contours

Stéfan van der Walt stefan at sun.ac.za
Sun Feb 24 23:58:27 EST 2013


On Mon, Feb 25, 2013 at 6:49 AM, zetah ven <otrov at hush.ai> wrote:
> I just tried the function, but I guess it works best for photo images, as
> line contours aren't reconstructed as expected. Anyhow thanks for the tip,
> it could be handy in future occasions I guess.

How about a very simple heuristic?  You extract all curves of a
certain color and fit a spline to them.  The, you consider all start
and endpoints that fall within a certain radius of one another,
connect them temporarily with a line segment, and see how
discontinuous the start/end points are with this new segment inserted
(e.g., meet the angle at which they meet).  If the angle is small
enough, trust that this is part of the contour and simply use a spline
fit to connect the start and endpoint.

Stéfan



More information about the scikit-image mailing list