开发者

image segmentation using pil/any package of python

开发者 https://www.devze.com 2022-12-27 00:33 出处:网络
i need to segment an image into regions .i开发者_运维技巧\'m using pil.i found no module to segment image in pil. I need this segmented regions as a list or dictionary.

i need to segment an image into regions .i开发者_运维技巧'm using pil.i found no module to segment image in pil. I need this segmented regions as a list or dictionary.

Actually i'm trying to compare the images for similarity in content aware fashion.for that i need to segment the image. i tried segwin tool but it is drawing another image(which is not required and also time consuming)

thans in advance


The easiest way to segment an image into regions is creating an other image called labelmap. The "region 1" is represented by all the 1 valued pixels within the labelmap, and so on. If you need the pixels of the "region 3" you just binarize the labelmap with a thershold equal to 3 and multiply the result with the original image.

Like Oliver I advise WrapItk.


For this task i prefer numpy and scipy. In terms of image processing these two have all you need. For array math i recommend numexpr. Take a look at http://docs.scipy.org/doc/scipy/reference/ndimage.html


Take a look at the PIL Handbook, you can use the "crop" function to get a subregion of the image.


You might want to try the python bindings for ITK, a segmentation tool in C++.

0

精彩评论

暂无评论...
验证码 换一张
取 消