Hi Payal, I think you're misunderstanding the purpose of "find_boundaries"... Not quite your fault since the documentation is pretty sparse there. I'll use my favourite fuzzball as an example: [image: Inline image 1] "find_boundaries" is meant to take in a segmentation, which is an image in which each region has a different integer label, like this one: [image: Inline image 2] Then, find_boundaries merely looks for pixels where the neighbouring labels are different: [image: Inline image 3] It's not doing any edge detection per se, it's just a tool for displaying segmentations when it is easier to look at edges than at regions (above). I think what you are after is edge detection? Maybe an image like this one: [image: Inline image 4] ? For that, you should directly use the edge detection algorithms, such as Sobel or Canny, without previously thresholding your image. Have a close look at the examples gallery to figure out if any are close to what you are after, and try to apply the code there to your own image: http://scikit-image.org/docs/dev/auto_examples/ Some of the more pertinent ones, I think: http://scikit-image.org/docs/dev/auto_examples/plot_canny.html http://scikit-image.org/docs/dev/auto_examples/plot_edge_filter.html http://scikit-image.org/docs/dev/auto_examples/plot_join_segmentations.html http://scikit-image.org/docs/dev/auto_examples/plot_label.html http://scikit-image.org/docs/dev/auto_examples/plot_marked_watershed.html http://scikit-image.org/docs/dev/auto_examples/plot_random_walker_segmentati... http://scikit-image.org/docs/dev/auto_examples/plot_watershed.html http://scikit-image.org/docs/dev/auto_examples/applications/plot_coins_segme... Note that in the edge detection examples, Canny/Sobel is applied to the image *before* any thresholding — unlike the example code you provided. Juan. On Wed, Sep 4, 2013 at 5:31 PM, Payal Gupta <erpayal2010@gmail.com> wrote:
hello everyone... i will try this code,in this i want to do read a image then do edge detection after that find the boundaries of image object. but find_boundaries return me a bool array but i need a integer array. is it any solution of this.
code::
import Image
from skimage import segmentation as seg,io,filter
imge = io.imread("IMG_1.jpg")
thresh = filter.threshold_otsu(imge)
binary = imge> thresh
edge_canny = filter.canny(binary)
bimg =seg.find_boundaries(binary)
print(bimg)
fig, (ax0, ax1) = plt.subplots(ncols=2)
ax0.imshow(bimg,cmap=plt.cm.gray) ax1.imshow(binary,cmap=plt.cm.gray)
On Tue, Sep 3, 2013 at 7:42 PM, Stéfan van der Walt <stefan@sun.ac.za>wrote:
On 3 Sep 2013 11:45, "Payal Gupta" <erpayal2010@gmail.com> wrote:
thanks it working but i confused when i use function of skimage
library. i want to change rgb image to a graylevel image but inbuilt function rgb2gray not convert gray level image.
reply.
If you want help on this list, please provide code examples of what you are attempting.
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@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@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
participants (1)
-
Juan Nunez-Iglesias