Image partition according to contours

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

line image looks like:

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

=================

  

 

Would this help? Colorize@MorphologicalComponents[ ColorNegate@Import[“http://i.stack.imgur.com/agPO0.png”], CornerNeighbors -> False]
– Szabolcs
Feb 20 ’14 at 0:03

=================

1 Answer
1

=================

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]