【问题标题】:MATLAB imshow/imagescMATLAB imshow/imagesc
【发布时间】:2013-04-16 04:02:02
【问题描述】:

我正在尝试使用某些参数绘制/显示图像,但它没有显示。只有轮廓。有谁知道我如何解决我的图像以显示参数和轮廓?在此先感谢

    imshow(image,'Border','tight','InitialMagnification',100)
    colormap(gray)
    hold on

    contour(phi,[0 0],'r')

【问题讨论】:

  • 你试过Google it吗?这是first search result...
  • 是的,imagesc 可以很好地处理轮廓,但我想要一个紧密的边框,我还没有找到 imagesc 的那些参数,但它不适用于 imshow
  • 那么问题的标题有误导性。
  • 您的代码对我来说很好用。在contour 行和imshow 行中取im=peaks(256)' and use im` 看看。

标签: matlab


【解决方案1】:

imshow 仅显示 UINT8 类型的图像。尝试imshow(uint8(image)) 并确保图像的值范围为 0 到 255(如果需要,可以缩放)。

如果您需要扩展,请执行

mI = min(min(image));
mA = max(max(image));
image = 255*(image-mI)/(mA-mI);
imshow(image);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-08
    • 2013-12-27
    • 1970-01-01
    • 1970-01-01
    • 2017-06-05
    • 2012-12-08
    相关资源
    最近更新 更多