Following the Jan 9th air quality open call I wanted to see what can be done with a microscope slide image of airborne particles. Inspired by the work started by Mathew and Stevie a couple of years ago I set out to try and get a similar process running on Python using openCV and skimage. Based on an old tutorial to detect coins I repurposed it for a single slide example. Once more example images are obtained this process could be made more robust, could also be a great candidate for DL!
Below is a code walkthrough:
1. load image, crop out the area with the scale on it.
2. Use Sobel edge detection to find particles.
3. Use a simple threshold to binarize the edges image.
4. Label binarized features.
5. Show area distribution of the particles
6. Sort and select only features which are larger than sizeTh (4 pX).
- NOTE: I made a lazy assumption that each pixel is 1 um, this parameter can be adapted in the code to show real scale, this is a pixel scale - NOT um!
6. TBC (use fractal dimension to detect if a particle is round or jagged). find a way to avoid false detection of two close particles, and from false detection of a section of large particles being reidentified by the label function.