以真彩的图像为例子:
代码1:
[plain] view plaincopy
1.
2.size(I1)
3.
size(I1)结果为:
[plain] view plaincopy
1.>> size(I1)
2.
3.ans =
4.
5. 440 300 3
结果为:
[plain] view plaincopy
1.
2.
3.ans =
4.
5.
6. FileModDate: '28-七月-2012 16:10:48'
7. FileSize: 396054
8. Format: 'bmp'
9. FormatVersion: 'Version 3 (Microsoft Windows 3.x)'
10. Width: 300
11. Height: 440
12. BitDepth: 24
13. ColorType: 'truecolor'
14. FormatSignature: 'BM'
15. NumColormapEntries: 0
16. Colormap: []
17. RedMask: []
18. GreenMask: []
19. BlueMask: []
20. ImageDataOffset: 54
21. BitmapHeaderSize: 40
22. NumPlanes: 1
23. CompressionType: 'none'
24. BitmapSize: 396000
25. HorzResolution: 0
26. VertResolution: 0
27. NumColorsUsed: 0
28. NumImportantColors: 0
代码2:
[plain] view plaincopy
1.
2.
此时将图像转换为并保存了下来。
代码3:
[plain] view plaincopy
1.
2.I2 = I1.*2
3.subplot(1,2,1),imshow(I1)
4.subplot(1,2,2),imshow(I2)
其中imshow()用来在窗口中显示图像。
结果为:
http://blog.csdn.net/choice1699/article/details/7796914下载本文