教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 说明书 >

模式识别导论 作业 2

来源:网络收集 时间:2026-05-03
导读: 模式识别 图像处理 《模式识别导论》第一讲作业2 3. 给出彩色图像bottles.tif直方图均衡的实现代码和结果。 f=imread('C:\Users\Administrator\Desktop\Pattern Recognition\bottles.tif'); hsi = rgb2hsi(f); %Change the RGB image to HIS figure %Extract

模式识别 图像处理

《模式识别导论》第一讲作业2

3. 给出彩色图像bottles.tif直方图均衡的实现代码和结果。

f=imread('C:\Users\Administrator\Desktop\Pattern Recognition\bottles.tif'); hsi = rgb2hsi(f);

%Change the RGB image to HIS figure

%Extract the three components h = hsi(:,:,1); s = hsi(:,:,2); i = hsi(:,:,3);

%Hue image

%Saturation image %Intensity image

%Show the three parts of the HSI image figure,imhist(h); figure,imhist(s); figure,imhist(i); ylim('auto');

gi = histeq(i,256); %Equalization of Intensity figure,imhist(gi)

%Shown as Fig 3.4 %Shown as Fig 3.1 %Shown as Fig 3.2 %Shown as Fig 3.3

gs = histeq(s,256); %Equalization of Saturation figure,imhist(gs) ylim('auto');

%Compose the three components to the “new” HIS image newi = cat(3,h,s,gi); news = cat(3,h,gs,i); newres = cat(3,h,gs,gi);

%Change the HSI image to RGB image resi = hsi2rgb(newi); ress = hsi2rgb(news); res = hsi2rgb(newres);

%Show the four results as Fig3.6~Fig3.8

1

%Shown as Fig 3.5

模式识别 图像处理

figure, imshow(resi), title('Intensity'); figure, imshow(ress), title(' Saturation');

figure, imshow(res), title(' Intensity&Saturation');

%Compare the three results and the original image shown as Fig3.9 subplot(2,2,1), imshow(f), title('Original'); subplot(2,2,2), imshow(resi), title('Intensity'); subplot(2,2,3), imshow(ress), title('Saturation');

subplot(2,2,4), imshow(res), title('Intensity&Saturation');

Fig 3.1 imhist(h)

2

模式识别 图像处理

Fig 3.2

imhist(s)

Fig 3.3 imhist(i)

3

模式识别 图像处理

Fig 3.4 Intensity分量均衡化直方图

Fig 3.5 Saturation分量均衡化直方图

4

模式识别 图像处理

Fig 3.6 Intensity分量均衡后的图像

Fig 3.7 Saturation分量均衡后的图像

5

模式识别 图像处理

Fig 3.8 Intensity分量和Saturation同时均衡后的图像

6

模式识别 图像处理

Fig 3.9 Compare the three results and the original image

4. 用相关匹配在图像(Hurricane.tif)中寻找与模板(mask.tif)最相似的子块,给出代码和相关系数图。

f = imread('Hurricane.tif'); w = imread('mask.tif'); g = dftcorr(f,w); gs = gscale(g); imshow(gs)

[I,J] = find(g==max(g(:))) figure,imshow(gs>254) x=corr2(f,gs)

7

模式识别 图像处理

Fig 4.1 相关运算结果

Fig 4.2 模版匹配结果

8

模式识别 图像处理

Results: I = 554 J = 203 x = 0.7754

9

…… 此处隐藏:1字,全部文档内容请下载后查看。喜欢就下载吧 ……
模式识别导论 作业 2.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/1484009.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)