R1(:,:,1)=A(:,:,1)
R1(:,:,2)=zeros(h,w)
R1(:,:,3)=zeros(h,w)
R=uint8(R1)
G1(:,:,2)=A(:,:,2)
G1(:,:,1)=zeros(h,w)
G1(:,:,3)=zeros(h,w)
G=uint8(G1)
B1(:,:,3)=A(:,:,3)
B1(:,:,2)=zeros(h,w)
B1(:,:,1)=zeros(h,w)
B=uint8(B1)
figure
subplot(1,3,1)
imshow(R)
subplot(1,3,2)
imshow(G)
subplot(1,3,3)
imshow(B)
clear all,clcim=imread('1.jpg'中枯)%1.jpg为图片乱培竖,在m文件所在目录下
s=size(im)
R=im(:,:,1)
G=im(:,:,2)
B=im(:,:,3)
R=reshape(R,[s(1),s(2)])
G=reshape(G,[s(1),s(2)])
B=reshape(B,[s(1),s(2)])
r=mean(mean(R))%红色均值
g=mean(mean(G))%绿色均值
b=mean(mean(B))%蓝色均哗大值
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)