clear all;
RGB = imread('D:\code\data\train\015.jpg'); %图片路径
HSV = rgb2hsv(RGB); %获得HSV图
subplot(121);imshow(RGB);title('RGB');%展示RGB图
subplot(122);imshow(HSV);title('HSV');%展示HSV图
R = RGB(:,:,1);%分通道
G = RGB(:,:,2);
B = RGB(:,:,3);
H = HSV(:,:,1);
S = HSV(:,:,2);
V = HSV(:,:,3);
figure;
subplot(131);imshow(H);title('H');%查看各通道图像
subplot(132);imshow(S);title('S');
subplot(133);imshow(V);title('V');
figure;
subplot(131);imshow(R);title('R');
subplot(132);imshow(G);title('G');
subplot(133);imshow(B);title('B');
学习笔记:matlab查看彩色图像的各个通道
最新推荐文章于 2023-03-08 21:58:43 发布