如何获取二进制图像轮廓的坐标?

时间:2014-11-19 11:19:35

标签: matlab image-processing graphics computer-vision matlab-figure

我有一个二进制图像,我想提取二进制图像轮廓的坐标。内置的contour()函数产生了double值,但我希望数组即系列(x,y)如果坐标是极坐标(x + iy)形式,也可以。有人可以帮我吗?

1 个答案:

答案 0 :(得分:2)

你可以通过用简单的小结构元素(磁盘/方块)侵蚀你的面具来获得轮廓遮罩

con = BW & ~imerode( BW, [0 1 0; 1 1 1; 0 1 0] ); 
figure; imshow( con ); title('contour mask');
[cy cx] = find(con); %// get coordinates of contour pixels

考虑到这一点,有几个(相关的)函数用于在图像处理工具箱中跟踪二进制掩码的边界。

您是否尝试过bwtraceboundarybwboundaries

相关问题