Wednesday, November 16, 2011

Particle tracking I : from analog to digital

Pinpointing the positions and sizes of tens of thousands particles from pictures. I can't miss one, I can't detect a particle where there is none. The precision must be extremely high. That is what I am doing routinely as the basis of my research. If I don't get this step right, my research has feet of clay, standing on sand.

In 1905 Einstein published three papers founding or revealing three different fields of physics : relativity, quantum mechanics and Brownian motion. The last one is a major breakthrough in statistical physics because if it was true, then matter was discontinuous, made of particles like atoms or molecules. However an experimental proof was needed.
Jean Baptiste Perrin

Jean Perrin exhibited this proof by the following experiments around 1908 : he suspended microscopic gamboge particles in water and waited for them to settle. Obviously their were more particles at the bottom than at the top ; however, how many more ? Perrin took a microscope and counted : how many particles do I see in average in a drop of suspension taken at 1 cm from the bottom (do it for 1000 drops to get a good average) ? How many at 2 cm ? etc. The concentration profile he got was perfectly fitting with theoretical predictions and thus discontinuity of matter was proved. Jean Perrin got the Nobel prize in physics 1926 for that.

A century later, how do you do track particles ? First, you don't need to stick your eye to a microscope. You take a digital picture with a CCD camera adapted to the microscope. Of course you can take movies.
A typical image of a dense colloidal suspension, taken by confocal microscope.
Now you have about ten thousand pictures like that out of a single experiment. Of course, you can superimpose the picture with a grid, locate the coordinates of a particle by following the grid with your finger, write them down in a notebook and so on and so forth. Perrin could have done that during years, but we have computer slaves.

Crocker and Grier designed the following algorithm to track individual particles from pictures. It is probably easier to understand if we imagine the intensity of each pixel as an altitude. For example, the two pictures below are equivalent.

Noisy picture of particles
Corresponding intensity profile
Blur your image to remove noise and to smooth the particles' intensity profile. Each particle should become a peak with no flatness at the top.

Previous picture, blurred

Find the pixels that are local intensity maxima. Their must be one per particle + others due to noise.
Local maxima

If you have large areas without particles, you may find local maxima there due to noise. If you remove the local maxima that are not bright enough, you should be left with only particles, none from noise. Now you know the coordinates of each particle centre with discreet (pixel) precision.
To increase the precision, you can take the centre of mass (intensity) of the pixels surrounding each possible centre. This gives subpixel resolution (about 1/10th of a pixel).

This is an extremely quick and efficient algorithm used routinely by many groups either in 2D or in 3D (yes, you can take 3D pictures, I'll have a post about it). You can check the official web page for more information. My own code for that is on sourceforge.

So far so good if your particles have the same size ... something that almost never append in nature, and not that often in experiments. I'll write about the more-than-one-size case in an other post.


  1. Mathieu good day. I work in a publishing house in Brazil. We are producing a chemistry textbook and the authors would like to use a microscope dense colloidal suspension, widely used in formulating lotions. This microscopy that appears on his posting corresponds to a microscopy used in the formulation of lotions?

  2. I don't think so. This is PMMA colloids coated with PDMS. They are made mainly for research purpose because they are expensive but have well controled properties.