what is the difference between image and imshow ?
110 views (last 30 days)
Brett Shoelson on 13 Feb 2011
image is a MATLAB command that visualizes your matrix as simply a matrix of numbers. The colors used to represent each value might be meaningless to the representation of the matrix as an image.
imshow is an Image Processing Toolbox command that treats your matrix as an image. It assumes that the elements are pixel intensities, and that you might want more control over the colormap, you probably don't want grid lines or axes tick marks, and you probably want to maintain the aspect ratio.
img = imread('cameraman.tif');
Colors are meaningless; even applying a seemingly reasonable colormap might give you unexpected results.
Even with the colormap established by the matrix-as-image, image gives you behavior you don't necessarily want from an image viewer. Cheers,
More Answers (1)
Walter Roberson on 18 Feb 2011
Bah, the only difference I see is the "axis image" and turning the ticks off, both of which are easy enough to do with image() without requiring the Image Processing Toolbox
I also found it quite easy to break the functionality of imshow(). It happened several times in a row for me. Unfortunately I can't reproduce it in an independent test.