Matlab 2015a imcontour

时间:2015-10-08 06:36:05

标签: matlab contour

Matlab改变了imcontour的行为,我无法弄清楚如何获得图像中每个轮廓的个体xy。

如果在2014a,代码为:

[~,g] = imcontour(img,1);
pgons=arrayfun(@(x) get(x,'Vertices'),get(g,'children'),'uni',false);

2015年,g是轮廓对象,我无法从中提取个体轮廓。

1 个答案:

答案 0 :(得分:0)

通过以下任一方式获得矩阵:

[contourMat,g] = imcontour(img,1);

其中,您正在寻找的是contourMap,或者

g.ContourMatrix