File Exchange

image thumbnail

Automated Counting of Bacterial Colonies

version 1.0.0.0 (175 KB) by Daniel Asarnow
A function to automate bacterial colony counting in images of plated agar in a Petri dish.

8 Downloads

Updated 02 Apr 2012

View License

Provides colony_count.m to automate counting of bacterial colonies.

The approach is as follows:

1. Use Hough transform to locate Petri dish.
2. Threshold with Otsu's method.
3. Count colonies as regional maxima in the original image which are present in the segmentation.

David Young's circular Hough transform functions are required. They are available here:
http://www.mathworks.com/matlabcentral/fileexchange/26978-hough-transform-for-circles

Currently, a range of Petri dish radii is required as a parameter.

This program was originally developed for a Stack Overflow question found here: http://stackoverflow.com/questions/9954891/counting-colonies-on-a-petri-dish.

Future plans are to increase versatility by automating parameter selection and reducing sensitivity to experimental and imaging conditions (lighting, bright/dark field, media color). Features suggested in comments will be considered for addition.

Comments and Ratings (5)

Aiwen Liu

Tianfang Xu

You need to use dark field images. Try inverting your image with imcomplement.

I inverted and shrank to 15% size and 103 colonies are counted. The lighting is uneven and correcting like in http://www.mathworks.com/help/images/examples/correcting-nonuniform-illumination.html will help obtain better results. With some experimentation I'm sure you can find the ideal parameters for your images!

Sagar SS

Hello sir, I am counting image with this code it gives very high numbers. may be because of RGB masking.
for the following image it shows 3743 count.
http://obrazki.elektroda.pl/9593898000_1422729658.jpg

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: Hough transform for circles