• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

试验一 matlab读取图像 - 幽幽若水

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

试验一 matlab读取图像

clear all, close all;

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

file_jpg=strcat(path,\'t1.jpg\');
%读取jpg图像
I1=imread(file_jpg); imshow(I1);
%读取dicom医学图像
file_dicom=strcat(path,\'ct1.dcm\');
I2=dicomread(file_dicom);
figure;imagesc(I2);
colormap(\'gray\');
dicominfo(file_dicom);
%将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

%把图像I1转换为HSV图像,分别显示H S V三个通道对应的图像
I1_hsv=rgb2hsv(I1); colormap(\'hsv\'); cmap=colormap; cmap=resize(cmap, [256,3],\'bicubic\'); cmap(1,:)=[1.0,1.0,1.0] figure(\'color\',\'white\'); imagesc(I1_hsv(: ,: ,1); colormap(cmap); axis off; axis equal; axis tight; figure(\'color\',\'white\'); imagesc(I1_hsv(: ,: ,2); colormap(\'gray\'); axis off; axis equal; axis tight; figure(\'color\',\'white\'); imagesc(I1_hsv(: ,: ,3); colormap(\'gray\'); axis off; axis equal; axis tight;

  

  

  


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap