bwconncomp doesn't count correctly

조회 수: 5 (최근 30일)
Eilaf Badr
Eilaf Badr 2018년 12월 13일
답변: Rahul punk 2019년 2월 15일
I'm having troubles counting bacterial colonies using bwconncomp function ......as it counts adjecent colonies as one single spot and also count the outer boundaries of the plate holding the bacteria ..... , This is my first time to write full code and I have to handle this project soon so I'm in desperate need of help .
I=imread('2010-07-28-17.06.301.jpg');
imshow(I);
h = imfreehand; %draw something
M = ~h.createMask();
I(M) = 0; % mask out the borders
imshow(I);
dim=size(I);
g=rgb2gray(I);
bw = im2bw(I,0.6);
se=strel('disk',4);
T=imopen(bw,se);
imshow(T);
T=imcomplement(T);
T=flipud(T);
BW_filled = imfill(T,'holes');
TT=imcrop(T); % remove borders
N=imcomplement(TT);
CC = bwconncomp(N,8);
imshow(T);
disp(CC);
original image
90 c.jpg
  댓글 수: 2
KSSV
KSSV 2018년 12월 13일
Attach your original image..so that people here can give you better solution.
Image Analyst
Image Analyst 2018년 12월 13일
If you're so desparate to get this done soon, then attach '2010-07-28-17.06.301.jpg'
In the meantime, try this link
Also, are you sure you need to count the number of colonies rather than just the area fraction? What happens if there was so many that about half the dish was covered? There would be no way to identify separate colonies in that case. So I'd just reconned computing the area fraction.

댓글을 달려면 로그인하십시오.

답변 (1개)

Rahul punk
Rahul punk 2019년 2월 15일
use this
https://www.mathworks.com/matlabcentral/fileexchange/70220-rahulpunk?s_tid=prof_contriblnk

카테고리

Help CenterFile Exchange에서 Particle Swarm에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by