计数培养皿上的菌落

HCA*_*CAI 10 matlab image-processing grayscale threshold

我有一堆充满点的培养皿,我想在Matlab中算一下.这可以可靠地分批完成吗?

例如,该板有352个菌落

在此输入图像描述

我已经尝试过ImageJ,但是需要做很多的边界裁剪并得到可变的结果.

你有什么建议吗?

rev*_*nge 14

我解决这个问题的方法如下:

  1. 使用霍夫变换来识别与培养皿相对应的圆圈.
  2. 使用Otsu的方法进行全局阈值处理,仅限于菜肴.
  3. 将菌落计数为原始图像的区域最大值,其在分割的图像中表示.

这个文件交换工具箱为我们提供了一个工作循环Hough变换.事情非常简单:

function [count,colonies,bw] = colony_count(I)

I = rgb2gray(im2double(I)); %# Color-to-gray conversion.
[m,n] = size(I);

%# Uncomment this if you have might have some images with light background
%# and dark colonies. It will invert any that seem that way.
%#if graythresh(I) < 0.5
%#    I = imcomplement(I);
%#end

bw = I > graythresh(I); %# Otsu's method.
radii = 115:1:130; %# Approx. size of plate, narrower range = faster.
h = circle_hough(bw,radii,'same','normalise'); %# Circular HT.
peaks = circle_houghpeaks(h, radii, 'npeaks', 10); %# Pick top 10 circles.

roi = true(m,n);
for peak = peaks
    [x, y] = circlepoints(peak(3)); %# Points on the circle of this radius.
    x = x + peak(1); %# Translate the circle appropriately.
    y = y + peak(2);
    roi = roi & poly2mask(x,y,m,n); %# Cumulative union of all circles.
end

%# Restrict segmentation to dish. The erosion is to make sure no dish pixels
%# are included in the segmentation.
bw = bw & bwmorph(roi,'erode');

%# Colonies are merged in the segmented image. Observing that colonies are 
%# quite bright, we can find a single point per colony by as the regional
%# maxima (the brightest points in the image) which occur in the segmentation.
colonies = imregionalmax(I) & bw;

%# Component labeling with 4-connectivity to avoid merging adjacent colonies.
bwcc = bwconncomp(colonies,4);
count = bwcc.NumObjects;
Run Code Online (Sandbox Code Playgroud)

我们使用这样的代码:

I = imread('http://i.stack.imgur.com/TiLS3.jpg');
[count,colonies,mask] = colony_count(I);
Run Code Online (Sandbox Code Playgroud)

我还在文件交换上传了这个colony_count功能.如果您的图像不起作用但您认为应该使用,请在那里留言.

计数是359,我认为这非常接近.您可以检查segmentation(mask)和colony标记(colonies)以查看错误发生的位置:

%# Leave out the changes to mask to just see the colony markers.
%# Then you can see why we are getting some false colonies.
R = I; R(mask) = 255; R(colonies) = 0;
G = I; G(mask) = 0; G(colonies) = 255;
B = I; B(mask) = 0; B(colonies) = 0;
RGB = cat(3,R,G,B);
imshow(RGB);
Run Code Online (Sandbox Code Playgroud)

  • 非常好的答案.只是评论说,最新版本的图像处理工具箱(12a)具有内置圆形霍夫变换的新功能. (2认同)