91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-16
  • 語(yǔ)言: Matlab
  • 標(biāo)簽: 人眼定位??MATLAB??

資源簡(jiǎn)介

使用MATLAB語(yǔ)言對(duì)人眼進(jìn)行定位,其中包括灰度變化,椒鹽變化,通過(guò)對(duì)圖像進(jìn)行兩次濾波,并的到兩個(gè)圖像的查分圖像,最后對(duì)眼睛進(jìn)行定位。

資源截圖

代碼片段和文件信息

%-------------------------------------------------------------------------
clear?all
x=imread(‘D:\tupian\QQ圖片20140913151659.jpg‘);??%讀取原始圖像
figure(1);subplot(141);imshow(x);title(‘原圖像1‘);
y=rgb2gray(x);
subplot(142);imshow(y);title(‘圖像1的灰度圖‘);???????????%?圖1灰度圖
u1=imnoise(y‘salt?&?pepper‘0.07);
subplot(143);imshow(u1);title(‘圖像1加噪聲圖‘);?????%給圖1加椒鹽噪聲
zz=medfilt2(u1[3?3]);z=medfilt2(zz[5?5]);%(2次中值濾波)
subplot(144);imshow(z);title(‘圖像1中值濾波‘);??%圖1中值濾波(3*3窗口)
%?figure(6);subplot(121);imshow(zz);title(‘一次濾波‘);
%?subplot(122);imshow(z);title(‘二次濾波‘);
x1=imread(‘D:\tupian\QQ圖片20140913151659.jpg‘);
figure(2);subplot(141);imshow(x1);title(‘原圖像2‘);
y1=rgb2gray(x1);
subplot(142);imshow(y1);title(‘圖像2灰度圖‘);????????????%圖2灰度圖
u2=imnoise(y1‘salt?&?pepper‘0.13);
subplot(143);imshow(u2);title(‘圖像2叫噪聲圖‘);????%圖2加椒鹽噪聲
zz1=medfilt2(u2[3?3]);z1=medfilt2(zz1[5?5]);%(2次中值濾波)
subplot(144);imshow(z1);title(‘圖像2濾波圖‘);??%圖2中值濾波
%?figure(5);subplot(121);imshow(zz1)title(‘一次濾波‘);
%?subplot(122);imshow(z1);title(‘二次濾波‘);
%?figure(3);subplot(121);imshow(z);title(‘處理后圖1‘);
%?figure(3);subplot(122);imshow(z1);title(‘處理后圖2‘);
f=imsubtract(z1z);???????????????????????????????????????????????%圖1圖2差分
figure(4);subplot(111);imshow(f);title(‘差分后圖像‘);
%?agin=medfilt2(f[3?3]);figure(10);imshow(agin);f=agin;???%差分圖中值濾波
%-------------------------------------------------------------------------




%-------------------------------------------------------------------------
%眼睛的粗定位
%標(biāo)注一只眼睛
[h?w]=size(f);
Amax=0;m=0;n=0;
for?i=10:h
??????for?j=10:w
????????????if?Amax<=f(ij)
???????????????Amax=f(ij);m=i;n=j;
????????????end
??????end
end
%標(biāo)另外一只眼睛
Bmax=0;m1=0;n1=0;
for?i1=10:m-10
????for?j1=10:w-10
??????????if?Bmax<=f(i1j1)
???????????Bmax=f(i1j1);m1=i1;n1=j1;
???????????end
????end
end
for?i2=m+10:h-10
????for?j2=10:w-10
??????????if?Bmax<=f(i2j2)
???????????Bmax=f(i2j2);m1=i2;n1=j2;
???????????end
????end
end
%判斷兩眼的參數(shù)是否符合要求
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






%----------------------------------------------------------------------

figure(7);imshow(z);hold?on;plot(nm‘+‘n1m1‘+‘);title(‘標(biāo)定眼睛圖‘);
%給眼睛畫(huà)上矩形框
figure(8);imshow(z)title(‘眼睛粗定位‘);hold?on;
Bvertex=[n-25?m-15;n+25?m+15];????%矩形的左上頂點(diǎn)坐標(biāo)和右下頂點(diǎn)坐標(biāo)
????plot([Bvertex(11)Bvertex(21)][Bvertex(12)Bvertex(12)]‘r‘)
????plot([Bvertex(21)Bvertex(21)][Bvertex(12)Bvertex(22)]‘r‘)
????plot([Bvertex(21)Bvertex(11)][Bvertex(22)Bvertex(22)]‘r‘)
????plot([Bvertex(11)Bvertex(11)][Bvertex(12)Bvertex(22)]‘r‘);
hold?on;
Bvertex=[n1-25?m1-15;n1+25?m1+15];????%矩形的左上頂點(diǎn)坐標(biāo)和右下頂點(diǎn)坐標(biāo)
????plot([Bvertex(11)Bvertex(21)][Bvertex(12)Bvertex(12)]‘r‘)
????plot([Bvertex(21)Bvertex(21)][Bvertex(12)Bvertex(22)]‘r‘)
????plot([Bvertex(21)Bvertex(11)][Bvertex(22)Bvertex(22)]‘r‘)
????plot([Bvertex(11)Bvertex(11)][Bvertex(12)Bvertex(22)]‘r‘);
%

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????6889??2014-09-13?15:18??yanjing.m

評(píng)論

共有 條評(píng)論