Discussion:
Contour segmentation from raster maps
zetah ven
2013-02-22 22:17:34 UTC
Permalink
Hi,

this doesn't seem like very active group, but writing anyway ( couldn't
find other ;), and hopefully to get some pointers as I didn't get from
Stack Exchange.
I'm comfortable in Python, and also love Gimp, so any pointer is welcome

I have topo map scan, like this excerpt (24bit unprocessed):
Loading Image...

I want to separate topological contours (brown lines in linked image). I
tried everything that come to my mind, like custom thresholding, thinning,
but as black lines and other objects are drawn over these brown contours I
always get discontinued contours, which are later rather useless as I can't
correct them one by one.

I thought that after thinning I'll get intersections in 1-2px, so that I
can do binary dilation after separating just brown contours, but to my
disappointment I can't reach it. I reduced image to 6 color palette and
here is thinning result: Loading Image... It's better than
nothing, but removing all colors but brown, still results in many
disconnected contours.

I then started googling, and found some papers, like: "Image Segmentation
Based on Variation Calculus", "Image Segmentation Using Active Contours",
and the like, which show just bare mathematical formalae that can't be
easily implemented even through Python.

Thanks
--
You received this message because you are subscribed to the Google Groups "pythonvision" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonvision+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Anthony Oliver
2013-02-25 19:26:27 UTC
Permalink
I hacked this up pretty quick with SimpleCV. It may not be exactly what
you may need to do some parameter tweaking but can probably get you want
you want.

http://imgur.com/I2imzGm


Code:
from SimpleCV import Image
contour_img = i.colorDistance((178.0, 162.0,
128.0)).stretch(0,30).erode().invert()
contours = contour_img.findBlobs()
contours.show()
Post by zetah ven
Hi,
this doesn't seem like very active group, but writing anyway ( couldn't
find other ;), and hopefully to get some pointers as I didn't get from
Stack Exchange.
I'm comfortable in Python, and also love Gimp, so any pointer is welcome
http://i.imgur.com/b2vS5nO.jpg
I want to separate topological contours (brown lines in linked image). I
tried everything that come to my mind, like custom thresholding, thinning,
but as black lines and other objects are drawn over these brown contours I
always get discontinued contours, which are later rather useless as I
can't correct them one by one.
I thought that after thinning I'll get intersections in 1-2px, so that I
can do binary dilation after separating just brown contours, but to my
disappointment I can't reach it. I reduced image to 6 color palette and
here is thinning result: http://i.imgur.com/YgwSn6t.png It's better than
nothing, but removing all colors but brown, still results in many
disconnected contours.
I then started googling, and found some papers, like: "Image Segmentation
Based on Variation Calculus", "Image Segmentation Using Active Contours",
and the like, which show just bare mathematical formalae that can't be
easily implemented even through Python.
Thanks
--
You received this message because you are subscribed to the Google Groups "pythonvision" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonvision+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Loading...