Get border pixels of labelled region

Payal Gupta erpayal2010 at gmail.com
Tue Sep 3 03:02:44 EDT 2013


hello..
thanks it working bt result not correct.
see the attachment. i want to find the boundary of this fig bt
find_boundary not work and do you know which function work as same
bwboundaries in matlab
please reply


On Mon, Sep 2, 2013 at 11:58 PM, Guillaume Gay <
guillaume at mitotic-machine.org> wrote:

>  You should use `io.imread('IMG_1.jpg')` instead of `Image.open`, which
> returns an `Image` object, not a numpy array.
>
>
>
>
> Le 02/09/2013 18:25, Payal Gupta a écrit :
>
>  code:
>
> import Image
>
> from skimage import segmentation as seg,io
>
> img = Image.open("IMG_1.jpg" , 'r')
>
> bimg =seg.find_boundaries(img)
>
> io.imshow(bimg)
>
>
>  error:
>
> Traceback (most recent call last):
>
>   File "<stdin>", line 1, in <module>
>
>   File
> "C:\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",
> line 523, in runfile
>
>     execfile(filename, namespace)
>
>   File "C:\Users\Dell\Documents\Python Scripts\final_try.py", line 12, in
> <module>
>
>     bimg =seg.find_boundaries(img)
>
>   File "C:\Anaconda\lib\site-packages\skimage\segmentation\boundaries.py",
> line 10, in find_boundaries
>
>     boundaries = np.zeros(label_img.shape, dtype=np.bool)
>
>   File "C:\Anaconda\lib\site-packages\PIL\Image.py", line 512, in
> __getattr__
>
>     raise AttributeError(name)
>
> AttributeError: shape
>
>
> On Mon, Sep 2, 2013 at 8:27 PM, Stéfan van der Walt <stefan at sun.ac.za>wrote:
>
>> On Mon, Sep 2, 2013 at 4:48 PM, Payal Gupta <erpayal2010 at gmail.com>
>> wrote:
>> > but this syntax segmentation.find_boundaries(img) not work
>> > where img is an image
>>
>>  Unless you send us a code snippet (e.g. on https://gist.github.com),
>> there is nothing we can do to help.
>>
>> Stéfan
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "scikit-image" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/scikit-image/rXRS0KT2PdU/unsubscribe.
>> To unsubscribe from this group and all of its topics, send an email to
>> scikit-image+unsubscribe at googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "scikit-image" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scikit-image+unsubscribe at googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "scikit-image" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/scikit-image/rXRS0KT2PdU/unsubscribe.
> To unsubscribe from this group and all of its topics, send an email to
> scikit-image+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20130903/b61a91d9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: figure_1.png
Type: image/png
Size: 34198 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20130903/b61a91d9/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IMG_1.JPG
Type: image/jpeg
Size: 89685 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20130903/b61a91d9/attachment.jpe>


More information about the scikit-image mailing list