sag
sag

Reputation: 475

image segmentation using pil/any package of python

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

Upvotes: 1

Views: 5791

Answers (4)

Mude
Mude

Reputation: 11

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

Upvotes: 1

crispamares
crispamares

Reputation: 530

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.

Upvotes: 2

Olivier Verdier
Olivier Verdier

Reputation: 49146

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

Upvotes: -2

Michael Aaron Safyan
Michael Aaron Safyan

Reputation: 95489

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

Upvotes: 0

Related Questions