问题描述
我试图找出Matlab中imshow(someImage, [])
中的第二个(空向量)参数是什么.
I am trying to figure out what the second (empty vector) parameter in imshow(someImage, [])
in Matlab is for.
根据doc imshow
,它要么是一个颜色图,要么是一个宽度/高度范围,但是由于矢量为空,所以这对我来说都不有意义.
According to doc imshow
, it's either a color map or a range of width/height, but neither of these make sense to me since the vector is empty.
推荐答案
带有空括号的imshow将显示最小值和最大值之间的范围.例如,如果您的图像为16位,则最大值为65536,但是如果您的实际像素值停在1000,则imshow(image)会显得很黑(因为在65536上甚至1000也很小).如果使用imshow(image,[]),则显示将在0到1000之间调整.
With the empty bracket imshow will display the range between the minimum and maximum value. For example, if your image is 16bits, the maximum value is 65536, but if your actual pixel values stop at 1000, imshow(image) will seem black (because even 1000 over 65536 is small). If you use imshow(image, []), then the display will be adjust between 0 and 1000.
与以下相同:
minValue = min(min(image));
maxValue = max(max(image));
imshow(image,[minValue maxValue]);
这篇关于imshow(someImage,[])`有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!