Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does `imshow(someImage, [])` do?

Tags:

matlab

I am trying to figure out what the second (empty vector) parameter in imshow(someImage, []) in Matlab is for.

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.

like image 587
dangerChihuahua007 Avatar asked Jan 12 '23 04:01

dangerChihuahua007


1 Answers

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.

It is the same as:

minValue = min(min(image));
maxValue = max(max(image));
imshow(image,[minValue maxValue]);
like image 109
Olivier Avatar answered Jan 18 '23 06:01

Olivier