实验二 matlab 数字图像基本操作
(1)读、写和保存图像
f=imread ('rose_512.jpg');
whos f
imshow(f);
g=f;
figure,imshow(g);
h=imread('chest-xray.jpg');
imshow(h,[ ]);
保存图像
f=imread('bubbles.jpg');
imshow(f);
imwrite(f, 'bubbles25.jpg ', 'quality ',25);
g25=imread('bubbles25.jpg ');
figure,imshow(g25,[ ]);
imfinfo bubbles25.jpg
K=imfinfo('bubbles25.jpg ');
Image_bytes=K.width*K.height*K.BitDepth/8;
Compressed_bytes=K.FileSize;
Compress_ratio=image_bytes/compressed_bytes