Automatic extraction of image regions

Hi,

I have a set of images: on every one of them there is a variable number of cells. Lets say I focus now on picture pic1.jpg with n cells. I want to find an automatic way to generate pictures from pic1_1.jpg to pic1_n.jpg - each of them having only a separate cell. Obviously, later on I would like to write some sort of a wrapper (maybe in Python?) to do this for every picture.
Does anyone have an idea how to get such an automatic way of splitting image into variable number of regions?

Hi @Maciek_Bak, and welcome!

First you need a method to automatically recognize the cells. There is no canned “recipe” for this – you have to work it out for your particular images. You can post an example if you’d like more specific suggestions.

If you are just getting started, this page gives an overview of the process:

After you have segmented the cells, the rest is easy, if you have fairly uniformly sized, well-separated cells.

You can use Analyze Particles to get the centroid of each cell.

Then you can crop your image at a defined distance from each cell centroid, thus generating a set of one-cell pictures.

Hope this helps for a start.

1 Like

Hi! I have a similar example but need to do it for rectangular boxes.
Can you have a look and help me find the area fraction?

I’ve asked a similar question at this link

Thanks!