I want to extract contours from following image or I am wondering how to partition following image:

line image looks like:

enter image description here

This question is linked: How to superimpose contour lines on transformed image

  • $\begingroup$ Would this help? Colorize@MorphologicalComponents[ ColorNegate@Import["http://i.stack.imgur.com/agPO0.png"], CornerNeighbors -> False] $\endgroup$
    – Szabolcs
    Feb 20 '14 at 0:03
i = Import["http://i.stack.imgur.com/agPO0.png"];
(mc = MorphologicalComponents[ColorNegate[i], CornerNeighbors -> False]) // Colorize
Grid@Partition[ Image /@ (Replace[mc, Except[#] -> 0, {2}] & /@ Range@Max@mc), 4]

Mathematica graphics


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.