views:

289

answers:

3

hi all.,

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

A: 

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

Michael Aaron Safyan
crop() just crops the image .but i want to segment the image.i.e., the image should be divided into regions(a region is a uniform part of the image)
sag
A: 

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

Olivier
This is about segmenting (clustering) data, not AFAICT image segmentation.
Vinay Sajip
+1  A: 

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.

crispamares