国产aaaa级全身裸体精油片_337p人体粉嫩久久久红粉影视_一区中文字幕在线观看_国产亚洲精品一区二区_欧美裸体男粗大1609_午夜亚洲激情电影av_黄色小说入口_日本精品久久久久中文字幕_少妇思春三a级_亚洲视频自拍偷拍

首頁 > 行業(yè)資訊 > 【圖像配準】基于surf算法實現(xiàn)圖像配準附Matlab代碼

【圖像配準】基于surf算法實現(xiàn)圖像配準附Matlab代碼

時間:2022-09-20 來源: 瀏覽:

【圖像配準】基于surf算法實現(xiàn)圖像配準附Matlab代碼

天天Matlab 天天Matlab
天天Matlab

TT_Matlab

博主簡介:擅長智能優(yōu)化算法、神經(jīng)網(wǎng)絡預測、信號處理、元胞自動機、圖像處理、路徑規(guī)劃、無人機等多種領域的Matlab仿真,完整matlab代碼或者程序定制加qq1575304183。

收錄于合集 #圖像處理matlab源碼 838個

1 內(nèi)容介紹

傳統(tǒng)的全景圖像配準多采用基于SIFT的方法,該方法數(shù)據(jù)量大,時間效率低.提出了一種基于SURF的全景圖像快速配準方法.運用SU RF提取特征點,計算特征描述符;運用低時間復雜度的K-D樹最近鄰搜索法實現(xiàn)特征點快速匹配;利用RANSAC算法剔除誤匹配點;最后估計出兩幅全景圖像的變換矩陣.測試表明:算法具有較高的時間效率和良好的魯棒性.

2 部分代碼

% Example 3, Affine registration

% Load images

clc

clear all

close all

tic

I1=im2double(imread(’TestImages/lena1.png’));

I2=im2double(imread(’TestImages/lena2.png’));

% Get the Key Points

Options.upright=true;

Options.tresh=0.0001;

Ipts1=OpenSurf(I1,Options);

Ipts2=OpenSurf(I2,Options);

% Put the landmark descriptors in a matrix

D1 = reshape([Ipts1.descriptor],64,[]);

D2 = reshape([Ipts2.descriptor],64,[]);

% Find the best matches

err=zeros(1,length(Ipts1));

cor1=1:length(Ipts1);

cor2=zeros(1,length(Ipts1));

for i=1:length(Ipts1),

    distance=sum((D2-repmat(D1(:,i),[1 length(Ipts2)])).^2,1);

    [err(i),cor2(i)]=min(distance);

end

% Sort matches on vector distance

[err, ind]=sort(err);

cor1=cor1(ind);

cor2=cor2(ind);

% Make vectors with the coordinates of the best matches

Pos1=[[Ipts1(cor1).y]’,[Ipts1(cor1).x]’];

Pos2=[[Ipts2(cor2).y]’,[Ipts2(cor2).x]’];

Pos1=Pos1(1:30,:);

Pos2=Pos2(1:30,:);

% Show both images

I = zeros([size(I1,1) size(I1,2)*2 size(I1,3)]);

I(:,1:size(I1,2),:)=I1; I(:,size(I1,2)+1:size(I1,2)+size(I2,2),:)=I2;

figure, imshow(I); hold on;

% Show the best matches

plot([Pos1(:,2) Pos2(:,2)+size(I1,2)]’,[Pos1(:,1) Pos2(:,1)]’,’-’);

plot([Pos1(:,2) Pos2(:,2)+size(I1,2)]’,[Pos1(:,1) Pos2(:,1)]’,’o’);

% Calculate affine matrix

Pos1(:,3)=1; Pos2(:,3)=1;

M=Pos1’/Pos2’;

% Add subfunctions to Matlab Search path

functionname=’OpenSurf.m’;

functiondir=which(functionname);

functiondir=functiondir(1:end-length(functionname));

addpath([functiondir ’/WarpFunctions’])

% Warp the image

I1_warped=affine_warp(I1,M,’bicubic’);

% Show the result

figure,

subplot(1,3,1), imshow(I1);title(’Figure 1’);

subplot(1,3,2), imshow(I2);title(’Figure 2’);

subplot(1,3,3), imshow(I1_warped);title(’Warped Figure 1’);

toc 

fprintf(’Found %d matches. ’, size(Pos1,1)) ;

fprintf(’Matched in %.3f s ’, toc) ;

3 運行結果

4 參考文獻

[1]陽吉斌, 胡訪宇, 朱高. 基于改進SURF算法的遙感圖像配準[J]. 電子測量技術, 2012, 35(3):5.

博主簡介:擅長 智能優(yōu)化算法 、 神經(jīng)網(wǎng)絡預測 、 信號處理 、 元胞自動機 、 圖像處理 、 路徑規(guī)劃 、 無人機 雷達通信 、 無線傳感器 等多種領域的Matlab仿真,相關matlab代碼問題可私信交流。

部分理論引用網(wǎng)絡文獻,若有侵權聯(lián)系博主刪除。

版權:如無特殊注明,文章轉載自網(wǎng)絡,侵權請聯(lián)系cnmhg168#163.com刪除!文件均為網(wǎng)友上傳,僅供研究和學習使用,務必24小時內(nèi)刪除。
相關推薦