1、JPEG压缩

  imwrite(原始图像,目标图像,'quality',比率)

  比率:[0, 100]  值越小,压缩比率越大

%% JPEG压缩
I = imread('cameraman.tif');
% imshow(I);
imwrite(I,'test.jpg','quality',10);
J = imread('test.jpg');
subplot(1,2,1),imshow(I);
subplot(1,2,2),imshow(J);

9. matlab图像处理基础——JPEG压缩+类型转换

2、类型转换

(1)RGB转灰度

  灰度图像 = rgb2gray(RGB图像)

%% RGB转灰度
I = imread('coloredChips.png');
subplot(1,2,1),imshow(I);
J = rgb2gray(I);
subplot(1,2,2),imshow(J);

9. matlab图像处理基础——JPEG压缩+类型转换

(2)灰度图像二值化

  二值图像 = imbinarize(灰度图像)

%% 灰度图像二值化
I = imread('cameraman.tif');
subplot(1,2,1),imshow(I);
J = imbinarize(I);
subplot(1,2,2),imshow(J);

9. matlab图像处理基础——JPEG压缩+类型转换

相关文章:

  • 2021-11-02
  • 2021-11-27
  • 2021-04-18
  • 2021-12-13
  • 2021-06-10
  • 2021-10-16
  • 2021-05-31
  • 2021-12-09
猜你喜欢
  • 2021-05-13
  • 2021-12-02
  • 2022-12-23
  • 2021-11-07
  • 2021-07-12
  • 2021-11-12
相关资源
相似解决方案