程序一 图形转换 灰度图像直方图均衡化
i=imread('f:ace3.jpg');j=rgb2gray(i);
imshow(j);imwrite(j,'f:ace3.tif')
程序二 灰度图像直方图均衡化
i=imread('f:ace3.tif');
j=histeq(i);imshow(j);
figure,subplot(1,2,1),imhist(i);
subplot(1,2,2),imhist(j)
程序三灰度图像平滑与锐化处理 和及加入噪声后图像的锐化
i=imread('f:ace3.tif');
j=imnoise(i,'gaussian',0,0.02);
subplot(1,2,1),imshow(j);
j1=wiener2(j);subplot(1,2,2),imshow(j1);
h=fspecial('gaussian',2,0.05);j2=imfilter(i,h);figure,subplot(1,2,1),imshow(i)
subplot(1,2,2),imshow(j2)
程序四 边缘检测
i=imread('f:ace3.tif');
j=edge(i,'canny',[0.04,0.25],1.5);
imshow(j)
程序五 人脸检测定位程序:
%%%%% Reading of a RGB image
I=imread('f:ace3.tif');
- 1
- 2
前往页