【问题标题】:Point of intersection of circle and binary image MATLAB圆的交点与二值图像MATLAB
【发布时间】:2013-06-03 06:49:26
【问题描述】:

我已经对二进制图像和连接信息进行了骨架化。我想以连接点为中心画圆,并想找到圆和二值图像的交点。 我写了以下代码:

 BW = imread('circles.png');
 imshow(BW);
 BW2 = bwmorph(BW,'remove');
 figure, imshow(BW2)
 BW3 = bwmorph(BW,'skel',Inf);
 figure, imshow(BW3)
 BW3t = bwmorph(BW3,'thin');
 figure, imshow(BW3t)


 [rj, cj, re, ce] = findendsjunctions(BW3t, 1);
 hold on 
 plot(cj(1),rj(1),'ob')
 hold on
 circle([cj(1),rj(1)],4,50,':r');

findendsjunctions.m 和依赖文件 show.m 可以分别从这里下载:http://www.csse.uwa.edu.au/~pk/research/matlabfns/LineSegments/findendsjunctions.m 和这里http://www.csse.uwa.edu.au/~pk/research/matlabfns/Misc/show.m。 而circle.m可以从这里下载:http://www.mathworks.co.uk/matlabcentral/fileexchange/2876-draw-a-circle/content/circle.m

我想知道圆圈是否与它周围的 2、3 或 4 个血管相交(在图像中标记为星形)。即使循环多次横穿单个血管,但输出应该是每个血管的一个交点。

请建议我如何找到圆形和二元血管的交点。

谢谢

【问题讨论】:

  • 你的问题?到目前为止你试图做什么?你有其他代码的链接,实现这些代码有什么问题?
  • @natan 上面的代码实现没有问题,但我的下一步是找到圆和二进制图像的交点。我想找到圆与二元容器相交的 3 个点(在图像中标记为星形)。你可以建议怎么做?
  • 查看 Andrey 的网页:matlabcorner.wordpress.com

标签: matlab image-processing


【解决方案1】:

我找到了圆和二进制图像的交点以及 3 个点的坐标(在我的问题提供的图像中标记为星形)。我已经更改了函数 circle.m(在我上面的问题中提到)以输出圆的圆周的所有 X 和 Y 坐标,然后我编写了以下 matlab 代码:

   [H, X, Y]=circle([cj(1),rj(1)],4,50,':r');
   c = improfile(BW3t,X,Y)
   x=1:length(c)
   figure
   plot(x, c,'r')

   [maxtab, mintab]=peakdet(c, 1)
   [pks,locs] = findpeaks(c)
   pt1=[X(locs(1)) Y(locs(1))]
   pt2=[X(locs(2)) Y(locs(2))]
   pt3=[X(locs(3)) Y(locs(3))]

   hold on
   plot(pt1(1),pt1(2),'om','LineWidth',2)
   hold on
   plot(pt2(1),pt2(2),'og','LineWidth',2)
   hold on
   plot(pt3(1),pt3(2),'ob','LineWidth',2)

pt1,pt2 pt3是圆切割二值图像的三个点

【讨论】:

    猜你喜欢
    • 2016-10-15
    • 1970-01-01
    • 2017-11-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-18
    • 2014-08-31
    • 2013-04-01
    相关资源
    最近更新 更多