Image Processing Toolbox | ![]() ![]() |
Troubleshooting
This section contains three common scenarios (in bold text) which can occur unexpectedly, and what you can do to derive the expected results.
My color image is displaying as grayscale. . Your image must be an indexed image, meaning that it should be displayed using a colormap. Perhaps you did not use the correct syntax for loading an indexed image, which is,
[X, map]=imread('filename.ext');
Also, be sure to use the correct form of imshow
for an indexed image.
imshow(X,map);
See Displaying Indexed Images for more information about displaying indexed images.
My binary image displays as all black pixels.. Check to see if its logical flag is "on." To do this, either use the islogical
command or call whos
. If the image is logical, the whos
command will display the word "logical" after the word "array" under the class heading. If you have created your own binary image, chances are it is of class uint8
, where a value of 1 is nearly black. Remember that the dynamic range of a uint8
intensity image is [0 255], not [0 1]. For more information about valid binary images, see Displaying Binary Images.
I have loaded a multiframe image but MATLAB only displays one frame. You must load each frame of a multiframe image separately. This can be done using a for
loop, and it may be helpful to first use imfinfo
to find out how many frames there are, and what their dimensions are. To see an example that loads all of the frames of a multiframe image, go to Displaying the Frames of a Multiframe Image Individually.
![]() | Printing Images | Geometric Operations | ![]() |