【问题标题】:Matlab: Filled contour plot with imcontourMatlab:使用 imcontour 填充的等高线图
【发布时间】:2016-07-29 15:21:01
【问题描述】:
我正在尝试从 MATLAB 中的图像创建填充轮廓图。但是,命令imcontour 似乎没有填充轮廓的选项。如果我使用contourf,它会将所有轮廓线绘制为黑色。由于图像具有很多轮廓级别,因此几乎完全以黑色显示。
有谁知道如何制作一个填充的imcontour 或如何在图像上有意义地应用contourf?
【问题讨论】:
标签:
matlab
image-processing
matlab-figure
contour
contourf
【解决方案1】:
imcontour 没有填充版本,因为理论上图像本身是填充版本。
data = load('clown');
img = ind2rgb(data.X, data.map);
imshow(img);
hold on
imcontour(img(:,:,1), 3);
您可以使用contourf 和specify the line color。通过指定值'none' 将不会显示任何行。
c = contourf(data, 2, 'LineColor', 'none')