Get border pixels of labelled region

Juan Nunez-Iglesias jni.soma at gmail.com
Wed Sep 11 10:04:49 EDT 2013


Hi Payal,

Please explain clearly what you are trying to do. We can't help you without
that. For example, what are the images you're using? What are you trying to
find within them? Your code is very confused:

image = io.imread("IMG_2.jpg")
>

What is this image?


> thresh = filter.threshold_otsu(image)
> binary = image > thresh
>

Why are you thresholding here?


> imag= color.colorconv.rgb2grey(binary)
> img = array(imag)
>

Converting a binary image using rgb2grey makes no sense.


> edge_canny = canny(img)
> edge_sobel = sobel(img)
> contours = measure.find_contours(imag,0.9,'high')
>

I don't think this function is what you want. If I'm not mistaken,
find_countours is used for isocline contour plots, such as this:
https://en.wikipedia.org/wiki/File:Contour2D.svg

print contours
> fig, (ax0, ax1) = plt.subplots(ncols=2)
> ax0.imshow(imag ,cmap=plt.cm.gray)
> ax0.set_title('Roberts Edge Detection')
> ax0.axis('off')
> ax1.imshow(edge_canny, cmap=plt.cm.gray)
> ax1.set_title('Sobel Edge Detection')
> ax1.axis('off')


Did you attach the images produced by this plot?

Juan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20130912/6ad223ec/attachment.html>


More information about the scikit-image mailing list