Matlab12b函数的难点imshow() [英] Difficulties with Matlab12b function imshow()

查看:118
本文介绍了Matlab12b函数的难点imshow()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MATLAB进行图像处理,我遇到了一条带有指令的代码:

  imshow(pixel_labels,[ ]); 

执行时会给出二进制图像。



<我已经在Mathworks.com上查看了该功能的手册,最相似的使用模式是

  imshow(I,[低高]); 

但他们没有说明该数组为空的情况( []



我试图删除它:

  imshow(pixel_labels); 

但我看到的只是白板。我想知道在第一个用例中发生了什么( imshow(pixel_labels,[])),我希望从那里我能理解为什么我会得到一个白板最后一个用例。

解决方案

如果我在MATLAB中输入 help imshow ,第一段写着:


IMSHOW(I,[LOW HIGH])显示灰度图像I,指定
显示我在[LOW HIGH]中的
范围。值LOW(和任何低于LOW的值)
显示为黑色,值HIGH(以及任何大于HIGH的值)显示
为白色。中间的值显示为灰色的中间色调,使用默认的灰度级数
。如果对
[LOW HIGH]使用空矩阵([]),IMSHOW使用[min(I(:))max(I(:))];也就是说,
I中的最小值显示为黑色,最大值显示为白色。


so [] 只是 [min(pixel_labels(:))max(pixel_labels(:))] 的缩写。


I'm using MATLAB for image processing and I came across a code with the instruction:

imshow(pixel_labels,[]); 

when executed it give a binary image.

I have check the manual of the function on Mathworks.com, the most similar used mode is

imshow(I,[low,high]);

but they don't say a thing about the case where that array is empty ([])

I tried to remove it:

imshow(pixel_labels); 

but all I see is a white board. I would like to know what is happening in the first use case (imshow(pixel_labels,[])), I hope from there I will understand why I get a white board in the last use case.

解决方案

If I type help imshow in MATLAB, the first paragraph reads:

IMSHOW(I,[LOW HIGH]) displays the grayscale image I, specifying the display range for I in [LOW HIGH]. The value LOW (and any value less than LOW) displays as black, the value HIGH (and any value greater than HIGH) displays as white. Values in between are displayed as intermediate shades of gray, using the default number of gray levels. If you use an empty matrix ([]) for [LOW HIGH], IMSHOW uses [min(I(:)) max(I(:))]; that is, the minimum value in I is displayed as black, and the maximum value is displayed as white.

so [] is simply shorthand for [min(pixel_labels(:)) max(pixel_labels(:))].

这篇关于Matlab12b函数的难点imshow()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆