<span id="mailbox-conversation"><div>Hi Robin!</div>
<div><br></div>
<div>Well, the easy workaround is to zoom your image a lot using ndi.zoom or skimage.transform.rescale, and then use mpl's contour. =)</div>
<div><br></div>
<div>The potentially slower way is to use scikit-image.segmentation.mark_boundary with mode=subpixel. =)</div>
<div><br></div>
<div>Juan.</div></span><div class="mailbox_signature">
<br><br></div>
<br><br><div class="gmail_quote"><p>On Mon, Oct 26, 2015 at 7:25 PM, Robin Wilson <span dir="ltr"><<a href="mailto:r.t.wilson.bak@googlemail.com" target="_blank">r.t.wilson.bak@googlemail.com</a>></span> wrote:<br></p><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>
<div dir="ltr">Hi,<div><br></div>
<div>I'm struggling with a problem that I'm sure has been solved before - and probably by some users of this mailing list! I have a segmentation image and I want to extract the edges of the segments and show them on the original image. This sounds nice and easy, so I had a go using the matplotlib contour function and got the following:</div>
<div><br></div>
<p class="separator" style="text-align: center; clear: both;"><a href="https://lh3.googleusercontent.com/-S2zawy2Wsq0/Vi3i9tFMwbI/AAAAAAADLj0/2Gt222-V4EE/s1600/ExampleContour.png" style="margin-left: 1em; margin-right: 1em;"><img src="https://lh3.googleusercontent.com/-S2zawy2Wsq0/Vi3i9tFMwbI/AAAAAAADLj0/2Gt222-V4EE/s1600/ExampleContour.png" border="0" style=""></a></p>
<div><br></div>
<div>From my perspective, there are two issues with this: one is that the two segments (which are separate by pixels with the value zero) are actually joined, and the other is that the segment outlines don't follow the pixel boundaries: they are offset by around half a pixel, and 'cut the corners'. What I'd really like to produce is the following:</div>
<div><br></div>
<p class="separator" style="text-align: center; clear: both;"><a href="https://lh3.googleusercontent.com/-UUwZAEhue8I/Vi3jQewKW-I/AAAAAAADLj8/gh66GU9-2yY/s1600/ExampleOutline.png" style="margin-left: 1em; margin-right: 1em;"><img src="https://lh3.googleusercontent.com/-UUwZAEhue8I/Vi3jQewKW-I/AAAAAAADLj8/gh66GU9-2yY/s1600/ExampleOutline.png" border="0" style=""></a></p>
<div><br></div>
<div>(if you look carefully you can see the blue outline around the edge of the segment)</div>
<div><br></div>
<div>Does anyone know how to do this easily (and, ideally, reasonably quickly) in Python? From my investigations it seems that the contour function won't do what I want - but I can't find anything else that will do this, and I'd rather not implement something from scratch.</div>
<div><br></div>
<div>Any thoughts?</div>
<div><br></div>
<div>Robin</div>
<div><br></div>
<div><br></div>
</div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups "scikit-image" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:scikit-image+unsubscribe@googlegroups.com">scikit-image+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.<br></div></blockquote></div><br>