IMAGE Team - The Pantheon project

Tutorial: Separating Aggregate of Objects

Identification

Resources

I. Objective

The objective is to separate objects that are grouped together in clusters so as to isolate each object in a specific region.

The separation is done with respect to the shape of the objects that is supposed to be convex.

In the present example, the goal is to isolate each cell into a single region. The input image is a binary image yielded by a preliminary segmentation process.

The initial image with the clusters.The result with individualized objects.

II. Method

The method for separating clusters of objects is based on the assumption that the objects (cells here) are convex, whereas the clusters are not. They have concavities in their shape. So the objects have only one ultimate erosion whereas the clusters have several, as illustrated by the following examples:

The separation is done in two steps:

  1. Detect the ultimate eroded.
  2. Locate the object boundary from their ultimate eroded.

II.1 Detecting the Ultimate Eroded

The ultimate eroded are calculated from the distance function to the region boundaries. These are the local maxima of the distance function. Before the detection, a Gaussian is applied in order to erode plateaus and create punctual maxima. Smoothing has also the advantage to merge very close maxima into one. As a matter of fact, the strength of smoothing can control the distance between two maxima.

A final masking by the initial binary image selects only the maxima inside the objects.

pany2pan input.png input.pan
pboundary 8 input.pan tmp1.pan
pdistance tmp1.pan tmp2.pan

pgaussianfiltering 1.5 tmp2.pan tmp3.pan
plocalmaxima 8 tmp3.pan tmp4.pan
pbinarization 1 1e30 tmp4.pan tmp5.pan

pmask tmp5.pan input.pan tmp6.pan
tmp2.pan: Distance image to region boundaries.
tmp6.pan: The local maxima superimposed on the initial image.

II.2 Localizing the Object Boundary

Local maxima are marked with a unique label and become the seeds of the localization process. The location is done using the watershed. It proceeds by propagation of the seeds controlled by the inverse of the distance to the region boundaries. The distance image is first masked by the initial binary image that set to 0 all pixels that are not part of the regions. After inversion, these values become very large and prevent uncontrolled spread of propagation.

pmask tmp2.pan input.pan tmp7.pan
pinverse tmp7.pan tmp8.pan

plabeling 8 tmp6.pan tmp9.pan

pwatershed tmp9.pan tmp8.pan tmp10.pan

pmask tmp10.pan input.pan output.pan
tmp9.pan: The seeds.
tmp10.pan: After the watershed operation.
output.pan: After masking by the initial binary image.

II.3 Visualization of the Result

This operation is just added for the sake of visualization. The cell boundaries are superimposed on the original image.

psuperimposition 1 input.pan output.pan result.pan
ppan2png result.pan output.png
result.pan: the resulted cells.

III. The Complete Pandore Script


The Pantheon project
Image Team GREYC Laboratory
UMR CNRS 6072 - ENSICAEN - University of Caen, France
This page was last modified on 31 October 2013