




已閱讀5頁,還剩4頁未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
harris角點(diǎn)檢測(cè)與ncc匹配(Harris point detection and NCC match)harris角點(diǎn)檢測(cè)與ncc匹配(Harris point detection and NCC match) Harris corner detection and NCC matching File1:- Function, y1, Y2, R, c=harris (X) % corner detection using the Harris algorithm % output is an image % result, CNT, R, c=harris (X) % CLC, clear all; % filename=qiao1.bmp; % X= imread (filename.bmp);% reads the image % Info=imfinfo (filename);%; this is customary % f=rgb2gray (X); F=X; % Ori_im=double (f) /255;%unit8 is converted to 64 double precision double64 FX = -2, -1 01, 2,% X direction gradient operator (for Harris corner extraction algorithm) Ix = Filter2 (FX, ori_im);% x directional filtering is good at using filter % FY = 5 85; 000; -5, -8, -5;% Gauss function, first order differential, Y direction (for improved Harris corner extraction algorithm) FY = -2; -1; 0; 1; 2;% Y direction gradient operator (used in Harris corner extraction algorithm) Iy = Filter2 (FY, ori_im);% y directional filtering Ix2 = Ix.2; Iy2 = Iy.2; Ixy = Ix.*Iy; Clear Ix; Clear Iy =% elimination variable ha H=, fspecial (gaussian, 10, 10, 2);% produces Gauss window functions of 7*7, sigma=2 Ix2 = Filter2 (h, Ix2); Iy2 = Filter2 (h, Iy2); Ixy = Filter2 (h, Ixy);% Gauss filtering, respectively Height = size (ori_im, 1); Width = size (ori_im, 2); Result = zeros (height, width);% record corner position, corner value is 1, background is black ha R = zeros (height, width); Rmax = 0;% the maximum R value in the image in order to set the threshold For I = 1:height For J = 1:width M = Ix2 (I, J), Ixy (I, J); Ixy (I, J), Iy2 (I, J);%2*2 matrix R (I, J) = det (M) -0.06* (trace (M) 2;% calculates R and obtains RMAX, which appears to be the whole, and the corner response function If R (I, J) Rmax Rmax = R (I, J); End; End; End; CNT = 0;% record count For I = 2:height-1 For J = 2:width-1% carry on non maximum suppression, window 3*3 If R (I, J) 0.01*Rmax & & R (I, J) R (i-1, J-1) and R (I, J) R (i-1, J) and R (I, J) R (i-1, j+1) and R (I, J) (I, J-1 R) and R (I, J) R (I, j+1) and R (I, J) R (i+1, J-1) and R (I, J) R (I +1 J) and R (I, J) R (i+1, j+1) Result (I, J) = 1; CNT = cnt+1; End; End; End; % % i=1; % for j=1:height % for k=1:width % if result (J, K) =1; % corners1 (I, 1) =j; % corners1 (I, 2) =k; % i=i+1; % end; % end; % end; posr, posc = find (result = 1); % corner number % imshow (ori_im)% and X have the same effect % hold on; % plot (posr, POSC,r.); Y1=result; Y2=cnt; R=posr; c=posc; Return; File2- Function, res=match (A1, cnt1, R1, C1, A2, CNT2, R2, C2) % res=match (A1, A2) % will find the best match point in A2 from A1 and get the res extracted from A2, that is, one-way search % result1, cnt1, R11, c11=harris (A1); CNT2, R22, result2%, c22=harris (A2);% can ensure to match what is, what % figure; % imshow (result1); title (result1 corner position); % figure; title (result2 corner position); % imshow (result2); Win=1/9 1/9 1/9; 1/9 1/9 1/9; 1/9 1/9 1/9; U1=filter2 (win, A1); U2=filter2 (win, A2);% for mean Research on image registration algorithm based on point feature A1=double (A1); A2=double (A2); A=filter2 (win, (a1-u1).2)% for variance B=filter2 (win, (a2-u2).2); m1, n1=size (A1); m2, n2=size (A2); Res1=zeros (M1, N1); Res2=zeros (m2, N2);% searched for matching points For s=1:cnt1 Max=0; p=0; q=0; i=r1 (s, 1); j=c1 (s, 1);%p.q stores coordinates For v=1:cnt2 M=r2 (V, 1); n=c2 (V, 1); K1= (A1 (i-1, J-1) -u1 (I, J) * (A2) (m-1, n-1) -u2 (m, n);% with result is to find what information, 3*3 for such a sparse point of no use K2= (A1 (i-1, J), -u1 (I, J) * (A2 (m-1, n) -u2 (m, n); K3= (A1 (i-1, j+1), -u1 (I, J) * (A2 (m-1, n+1) -u2 (m, n)% is better with loop K4= (A1 (I, J-1), -u1 (I, J) * (A2 (m, n-1) -u2 (m, n); K5= (A1 (I, J), -u1 (I, J) * (A2 (m, n) -u2 (m, n); K6= (A1 (I, j+1), -u1 (I, J) * (A2 (m, n+1) -u2 (m, n); K7= (A1 (i+1, J-1), -u1 (I, J) * (A2 (m+1, n-1) -u2 (m, n); K8= (A1 (i+1, J), -u1 (I, J) * (A2 (m+1, n) -u2 (m, n); K9= (A1 (i+1, j+1), -u1 (I, J) * (A2 (m+1, n+1) -u2 (m, n); Num=k1+k2+k3+k4+k5+k6+k7+k8+k9; Den=sqrt (A (I, J) *B (m, n); Ncc=num/den; If nccmax Max=ncc; p=m; q=n; End End Res2 (P, q) =1; End % can not do it, you can search for a point first Res=res2; Return File3- % The matching of% characteristic points is mainly based on the detection of Harris corner points and match one-way matching function % is suitable for images with white edges, because, when windowed filtering, there is no limit to the extent of Kazakhstan, as far as possible to ensure that the corner is not on the edge CLC, clear, all; A1=imread (qiao1.bmp); A2=imread (qiao2.bmp); The role of%double is great Subplot (1,2,1); imshow (A1); subplot (1,2,2); imshow (A2); title (original image); result1, cnt1, R1, c1=harris (A1);% corner detection, the raw focus position map result is obtained result2, CNT2, R2, c2=harris (A2); Figure; subplot (1,2,1); imshow (A1); hold, on; plot (C1, R1,g.); Subplot (1,2,2); imshow (A2); hold, on; plot (C2, R2,g.); title ( graph 1, 2 corner graph); Res2=match (A1, cnt1, R1, C1, A2, CNT2, R2, C2);% starts from result1 and searches possible in result2 r22, c22=find (res2=1); m22, n22=size (R22); Cnt22=m22; Res1=match (A2, cnt22, R22, C22, A1, cnt1, R1, C1);% reverse search res2-result1 Res1=and (res1, result1);% guarantees that the reverse matching does not appear to be impossible r11, c11=find (res1=1); m11, n11=size (R11); Cnt11=m11; Res22=match (A1, cnt11, R11, C11, A2, cnt22, R22, C22);% starts from res1 and searches poss
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 帝王潔具活動(dòng)方案
- 小熊拔牙綜合活動(dòng)方案
- 少先隊(duì)設(shè)計(jì)達(dá)人活動(dòng)方案
- 少先隊(duì)采摘活動(dòng)方案
- 小班芒種活動(dòng)方案
- 少兒口才策劃活動(dòng)方案
- 小學(xué)除雪行動(dòng)活動(dòng)方案
- 小組研磨活動(dòng)方案
- 小學(xué)評(píng)先樹優(yōu)活動(dòng)方案
- 小班年俗活動(dòng)方案
- 國家開放大學(xué)《水利水電工程造價(jià)管理》形考任務(wù)1-4參考答案
- 《掃除道》樊登讀書文字版
- 教學(xué)演示文稿,建筑企業(yè)科技創(chuàng)新方法講座()
- 裝飾工程材料清單
- 模具年度保養(yǎng)計(jì)劃表
- 中國傳統(tǒng)節(jié)日文化中現(xiàn)代德育價(jià)值的研究課題結(jié)題報(bào)告
- DBJ61T1492018陜西省城鎮(zhèn)住區(qū)公共服務(wù)設(shè)施配置標(biāo)準(zhǔn).pdf
- 肺動(dòng)脈導(dǎo)管監(jiān)測(cè)的參數(shù)及意義
- 職稱評(píng)審申報(bào)系統(tǒng)PPT課件
- 水利工程漿砌石工程監(jiān)理細(xì)則
- 成品檢驗(yàn)記錄
評(píng)論
0/150
提交評(píng)論