- 15
- 0
- 约8.96千字
- 约 8页
- 2017-01-09 发布于重庆
- 举报
《数字图像处理》实验指导书201403.
1.直方图均衡化
clear all; close all % Clear the MATLAB workspace of any variables
% and close open figure windows.
I = imread(pout.tif); % Reads the sample images ‘ pout.tif’, and stores it in
imshow(I) % an array named I.display the image
figure, imhist(I) % Create a histogram of the image and display it in
% a new figure window.
[I2,T] = histeq(I); % Histogram equalization.
figure, imshow(I2) % Display the new equalized image, I2, in a new figure window.
figure, imhist(I2) % Create a histogram of the equalized image I2.
figure,plot((0:255)/255,T); % plot the transformation curve.
imwrite (I2, pout2.png); % Write the newly adjusted image I2 to a disk file named
% ‘pout2.png’.
imfinfo(pout2.png) % Check the contents of the newly written file
2.直接灰度变换
clear all; close all
I = imread(cameraman.tif);
J = imadjust(I,[0 0.2],[0.5 1]);
imshow(I)
figure, imshow(J)
[X,map] = imread(forest.tif);
figure,imshow(X,map)
I2 = ind2gray(X,map);
J2 = imadjust(I2,[],[],0.5);
figure,imshow(I2)
figure, imshow(J2)
J3 = imadjust(I2,[],[],1.5);
figure, imshow(J3)
help imadjust % Display the imadjust() function information.
3.空域平滑滤波(模糊、去噪)
clear all; close all
I = imread(eight.tif);
h1 = ones(3,3) / 9;
h2 = ones(5,5) / 25;
I1 = imfilter(I,h1);
I2 = imfilter(I,h2);
figure(1), imshow(I), title(Original Image);
figure(2), imshow(I1), title(Filtered Image With 3*3 )
figure(3), imshow(I2), title(Filtered Image With 5*5 )
% 加入Gaussian 噪声
J1 = imnoise(I,gaussian,0,0.005);
% 加入椒盐噪声
J2 = imnoise(I,salt pepper,0.02);
% 对J1、J2进行平均值平滑滤波
K1 = imfilter(J1,fspecial(average,3));
K2 = imfilter(J2,fspecial(average,3));
figure(4);
subplot(2,2,1), imshow(J1) , title(gaussian);
subplot(2,2,2), imshow(J2), title(salt pepper );
subplot(2,2,3), imshow(K1), title(average );
subplot(2,2,4), imshow(K2);
% 对J1、J2进行中值滤波
K3 = medfilt2(J1,[3 3]);
K4 = medfilt2(J2,[3 3]);
figure(5);
subplot(2,2,1), imshow(J1) , title(gaussian);
subplot(2,2,
您可能关注的文档
- 《接入网技术》知识点总结..doc
- 《接入网技术》综合练习题解答..docx
- SIFT详解.docx
- 《接触网》教案补充电力机车知识..doc
- 大棚西瓜早春茬栽培技术.doc
- 《提高历史与社会课堂提问有效性的实践与研究》结题报告..doc
- 《搭配中的学问》教学设计--冯小兵..doc
- 《操作系统》习题课..doc
- 《支付结算办法》.doc
- 《放松心态,轻松应考》主题班会【三3】..doc
- 小区绿化施工协议书.docx
- 墙面施工协议书.docx
- 1 古诗二首(课件)--2025-2026学年统编版语文二年级下册.pptx
- (2026春新版)部编版八年级道德与法治下册《3.1《公民基本权利》PPT课件.pptx
- (2026春新版)部编版八年级道德与法治下册《4.3《依法履行义务》PPT课件.pptx
- (2026春新版)部编版八年级道德与法治下册《6.2《按劳分配为主体、多种分配方式并存》PPT课件.pptx
- (2026春新版)部编版八年级道德与法治下册《6.1《公有制为主体、多种所有制经济共同发展》PPT课件.pptx
- 初三教学管理交流发言稿.docx
- 小学生课外阅读总结.docx
- 餐饮门店夜经济运营的社会责任报告(夜间贡献)撰写流程试题库及答案.doc
原创力文档

文档评论(0)