In lab 1, we learn how to:
- read and display an image
- check how the image appears in the workspace
- perform histogram equalization on the image
- write the image to a disk
- get information about a graphics file
Firstly, to read an image file we use the I=imread('pout.tif'); command.
The pout.tif according to the image name.
Then type imshow(I) to show the image file.
To view the image file size in memory, we used the whos command.
After that we put the figure, imhist(I) to show the image histogram.
As we can see, the histogram show that the intensity not cover the potential range of image which is [0, 255].
Then we used the I2 = histeq(I); command to improve the intensity into the full potential range, also improving the contrast.
After that we can display the image file and the histogram using the figure, imshow(I2) and figure, imhist(I2) command.
We can see that the new histogram show the pixel value extend across the full range of the possible value.
Lastly, if u want to save the new image file, type the imwrite (I2, 'pout2.png'); command and type imfinfo('pout2.png') to view the image information....
That's all... Thanks you ;)
No comments:
Post a Comment