我正在使用MATLAB来分析细胞图像。目前,我只能检测和测量圆形细胞(图像附加)。有没有办法,我可以检测到其他细胞并测量它们?也许,通过为所有细胞添加轮廓然后测量?
到目前为止代码:
tic
close all
clear all
dir = 'C:\Users\CBE user 70\Google Drive\Gloria - PhD\PhD Thesis\Chapter 4 - DS coculture\Pictures\DSHALO MBB\16MARCH\';
FileName = 'DH1L116march(2).JPG';
Pixel2MicroMeterRatio = 6;
HistBinEdges = [5:1:25 ];
vi = 0.05; % vertical increase in sublpot size (normalized)
hi = 0.08; % horizontal increase in sublpot size (normalized)
i = imread([dir,FileName]);
i2 = i(:,:,3);
i2= imadjust(i2);
% increase imfindcircles from [11 50] to [5 99], as the cells here are
% larger here
[CircCenter, CircRadii] = imfindcircles(i2,[5 99],'ObjectPolarity','dark');
NumOfCells = length(CircRadii);
sp(1) = subplot(2,2,1);
imshow(i)
sp(2) = subplot(2,2,2);
imshow(i2)
hold on
c=viscircles(CircCenter, CircRadii,'EdgeColor','r','linewidth',1,'linestyle',':');
c.Children(2).Visible = 'off';
for i=1:NumOfCells
text(CircCenter(i,1),CircCenter(i,2),num2str(i),'fontsize',6,'color','c','HorizontalAlignment','center','VerticalAlignment','middle')
end