how to get the individual boundary of a sperm cell when some of the cells are overlapped.
1 回表示 (過去 30 日間)
古いコメントを表示
I was working on drawing the boundary of sperm cell. Attached is a sample graph. I draw the contour of the sperm cell, and the command imcontour or bwboundary both will give me the boundary in two different ways. However, there are some sperm cells, whose tails are crossed. Then here comes the problem. How can I get one individual sperm cell out of the figure? Since they are crossed, if I get the boundary for one of the cell, the tail may be the other sperm's.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/195355/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/195356/image.png)
for example: if I have the graph below on the left, how can I decide whether it is actually the top right shape or the bottom right shape.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/195357/image.png)
2 件のコメント
Image Analyst
2018 年 9 月 6 日
Why do you need the tails? If you just want to count how many are there you can just lower your threshold and count the dark heads.
回答 (1 件)
KSSV
2018 年 9 月 7 日
How about this approach?
I = imread('sperm.png') ;
I = rgb2gray(I) ;
[y,x] = find(~I) ;
mx = mean(x) ; my = mean(y) ;
xi = x-mx ; yi = y-my ;
figure
hold on
plot(xi,yi,'.r')
% First quadrant
x1 = xi(xi>0) ; y1 = yi(xi>0) ;
Q1 = [x1(y1>0) y1(y1>0)] ;
plot(Q1(:,1),Q1(:,2),'.b')
% SEcond quadrant
x2 = xi(xi<0) ; y2 = yi(xi<0) ;
Q2 = [x2(y2>0) y2(y2>0)] ;
plot(Q2(:,1),Q2(:,2),'.g')
% Third quadrant
x3 = xi(xi<0) ; y3 = yi(xi<0) ;
Q3 = [x3(y3<0) y3(y3<0)] ;
plot(Q3(:,1),Q3(:,2),'.k')
% Fourth quadrant
x4 = xi(xi>0) ; y4 = yi(xi>0) ;
Q4 = [x4(y4<0) y4(y4<0)] ;
plot(Q4(:,1),Q4(:,2),'.m')
%%Join
Q13 = [Q1 ; Q3] ;
Q24 = [Q2 ; Q4] ;
figure
hold on
plot(Q13(:,1),Q13(:,2),'.r')
plot(Q24(:,1),Q24(:,2),'.b')
Q14 = [Q1 ; Q4] ;
Q23 = [Q2 ; Q3] ;
figure
hold on
plot(Q14(:,1),Q14(:,2),'.r')
plot(Q23(:,1),Q23(:,2),'.b')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/195142/image.png)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!