读取图片
imshow('E:\hh.bmp')
impixelregion
上述语句可查看图片的像素值
下列语句同样可以查看像素值
imageViewer('E:\hh.bmp')
将图片放大到足够大后,会自动显示出图片信息
对彩色图片进行操作
rgb_image=imread('E:\hh.bmp');%读取图片
subplot(121)
imshow(rgb_image)
fR=rgb_image(:, :, 1);%读取红色分量
fG=rgb_image(:, :, 2);%读取绿色分量
fB=rgb_image(:, :, 3);%读取蓝色分量
[m,n]=size(fR);
for i=1:m
for j=1:n
fR(i,j)=0;
end
end
rgb=cat(3,fR,fG,fB);
subplot(122)
imshow(rgb)
将图片的红色分量删除,全设置为0