【问题标题】:How to trace the surface area as well as smoothen a specific region in an image using MATLAB如何使用 MATLAB 跟踪表面区域以及平滑图像中的特定区域
【发布时间】:2017-08-28 01:05:47
【问题描述】:

我有一张有 6 种颜色的图像,每种颜色都表示一个值。我得到了如下图。

我需要平滑边缘,然后找出该区域的面积和表面积。第二张图片显示了在边缘绘制的一条黑线,这表明我需要以这种方式平滑边缘。

如第三张图所示,我曾使用分割创建蒙版,然后使用图像后面的代码获得分割后的图像。

我使用以下代码生成蒙版图像。 来源:How to segment

 imshow(Out1)  
 str = 'Click to select initial contour location. Double-click to confirm    and proceed.';
 title(str,'Color','b','FontSize',12);
 disp(sprintf('\nNote: Click close to object boundaries for more accurate   result.'));
 mask = roipoly;
 figure, imshow(mask)
 title('Initial MASK');
 maxIterations = 3000; 
 bw = activecontour(Out1, mask, maxIterations, 'Chan-Vese');

 % Display segmented image
 figure, imshow(bw)
 title('Segmented Image');

为了使用“activecontour”功能,我的图像需要是灰度图像,我无法将其转换为灰度图像并返回。还要找出该区域的表面积/面积是否有任何内置功能。请帮忙谢谢。

【问题讨论】:

    标签: image matlab area image-segmentation geometry-surface


    【解决方案1】:

    使用im2doubleim2uint8等将二值图像转为灰度。

    使用bwarearegionprops查找区域区域。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多