首页 > 其他 > 详细

试验一 matlab读取图像

时间:2020-06-03 09:28:16      阅读:94      评论:0      收藏:0      [点我收藏+]
clear all, close all;

path=‘C:\Users\Administrator\Desktop\‘;

file=strcat(path,‘t1.jpg‘);
I1=imread(file); imshow(I1);


%将I1以0.1(或0.3)的压缩比储存 imwrite(I1,strcat(path,‘t2.jpg‘),‘Quality‘,10)); imwrite(I1,strcat(path,‘t3.jpg‘),‘Quality‘,30)); %绘制I1 R G B 三个通道的直方图 figure(‘color‘,‘white‘); imagesc(I1(: ,: ,1); colormap([(0, 1/255, 1)‘,zeros(256,1),zeros(256,1)]); axis=off; figure(‘color‘,‘white‘); imagesc(I1(: ,: ,2); colormap([zeros(256,1),(0, 1/255, 1)‘,zeros(256,1)]); axis=off; figure(‘color‘,‘white‘); imagesc(I1(: ,: ,3); colormap([zeros(256,1),zeros(256,1),(0, 1/255, 1)‘]); axis=off;
%绘制不同通道的直方图 figure(‘color‘,‘white‘); for i=1:3 subplot(:,:,i);imhis(I1(:,:,i)); title(strcat(‘r g b channel‘,num2str(i)); end

  

试验一 matlab读取图像

原文:https://www.cnblogs.com/kcy11993/p/13034782.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!