Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

share|improve this question
    
Would this help? Colorize@MorphologicalComponents[ ColorNegate@Import["http://i.stack.imgur.com/agPO0.png"], CornerNeighbors -> False] –  Szabolcs Feb 20 at 0:03
add comment

1 Answer

up vote 5 down vote accepted
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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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