|

楼主 |
发表于 2023-2-20 20:32:35
|
显示全部楼层
改进代码
- clc; % clear command window
- clear all;
- % imread : read image 读取图片
- I = imread('lena.jpg');
- %运行完之后I的类型是uint8, unsigned integer 8,无符号8位整,范围 0-255
- %imshow :show image 显示图片
- I_red = I(:,:,1);
- I_green = I(:,:,2);
- I_blue = I(:,:,3);
- %subplot 划分画布
- subplot(2,2,1);imshow(I);title('raw');
- subplot(2,2,2);imshow(I_red);title('red');
- subplot(2,2,3);imshow(I_green);title('green');
- subplot(2,2,4);imshow(I_blue);title('blue');
复制代码 |
|