matlab相关函数(matlab相关函数)
matlab相关函数(matlab相关函数)
% imshow
Imshow is used to display pictures, such as
"I = imread ('moon.tif')";
> figure, imshow (I);
Sometimes, in order to process data, the read picture information is converted to higher precision,
"I = Double" (imread ('moon.tif'));
In order to ensure accuracy, after the operation of the image matrix I, the data type will change from Unit8 to double. If you run imshow (I) directly, we'll see a white image. This is because when imshow () displays the image, the double is thought to be white in the 0~1 range, or greater than 1, while the imshow shows the 0~255 range when the uint8 type is displayed. The double data passing through the range of 0-255 is abnormally displayed as a white image.
There are two solutions:
1> imshow (I/256); - transforms an image matrix to 0-1
2> imshow (I, []); - automatically adjust the range of data for display.
From the experimental results, the two methods have solved the problem, but from the image shown, the second methods show a strong picture of black and white contrast!
+++++++++++++++++++++++++++++++++++++++
IMSHOW (I), displays, the, grayscale, image, I.
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 white. Values in) as 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.
+++++++++++++++++++++++++++++++++++++++
The image is y, why is imshow (uint8 (y)) and imshow (y, []) when the images show different results?
Answer:
Imshow (uint8 (y)) is in accordance with the 256 gray scale display, y absolute data. 0 stands for black, 255 means white, and values greater than 255 in y are forced to 255.
Imshow (y, y, []