【圖像配準(zhǔn)】基于surf算法實(shí)現(xiàn)圖像配準(zhǔn)附Matlab代碼
【圖像配準(zhǔn)】基于surf算法實(shí)現(xiàn)圖像配準(zhǔn)附Matlab代碼
TT_Matlab
博主簡介:擅長智能優(yōu)化算法、神經(jīng)網(wǎng)絡(luò)預(yù)測、信號處理、元胞自動機(jī)、圖像處理、路徑規(guī)劃、無人機(jī)等多種領(lǐng)域的Matlab仿真,完整matlab代碼或者程序定制加qq1575304183。
1 內(nèi)容介紹
圖像配準(zhǔn) (imageregistration ) 是將不同時(shí)相 ( 獲取時(shí)間 ) 、 不同傳感器 ( 成像設(shè)備 ) 或不同條件 ( 天候 、 照度 、 攝像位置和角度 ) 下獲取的 2 景或多景圖像進(jìn)行幾何匹配的過程 。 隨著信息技術(shù)的迅猛發(fā)展 , 傳統(tǒng)的基于灰度值和變換域的圖像配準(zhǔn)技術(shù)已難以滿足需要 , 基于影像特征的高精度圖像配準(zhǔn)方法已經(jīng)成為當(dāng)前圖像配準(zhǔn)技術(shù)的研究趨勢 。 近年來 , 國內(nèi)外涌現(xiàn)出了大量基于影像特征的圖像配準(zhǔn)方法研究 , 包括特征點(diǎn) 、 邊緣 、 區(qū)域和輪廓等。特征點(diǎn)的提取相對容易 , 且不易受空間分辨率 、 光照條件等圖像變化的影響而被廣泛應(yīng)用 。 SU R F 算法是在 SIFT 算法的基礎(chǔ)上提出的一種快速魯棒特征提取的配準(zhǔn)算法。 基于 SU R F 算法的圖像配準(zhǔn)主要包括圖像特征點(diǎn)提取 、 特征點(diǎn)匹配 、去除誤匹配點(diǎn) 、 確定匹配模型和圖像重采樣 4 個(gè)方面。 而在利用傳統(tǒng) SU R F 算法進(jìn)行圖像配準(zhǔn)時(shí) , 提取的特征點(diǎn)分布不均 , 會導(dǎo)致匹配的特征點(diǎn)出現(xiàn)局部集中現(xiàn)象 , 使圖像配準(zhǔn)誤差較大而影響整體配準(zhǔn)的精度 。
2 部分代碼
function ipts=OpenSurf(img,Options)
% This function OPENSURF, is an implementation of SURF (Speeded Up Robust
% Features). SURF will detect landmark points in an image, and describe
% the points by a vector which is robust against (a little bit) rotation
% ,scaling and noise. It can be used in the same way as SIFT (Scale-invariant
% feature transform) which is patented. Thus to align (register) two
% or more images based on corresponding points, or make 3D reconstructions.
%
% This Matlab implementation of Surf is a direct translation of the
% OpenSurf C# code of Chris Evans, and gives exactly the same answer.
% Chris Evans wrote one of the best, well structured all inclusive SURF
% implementations. On his site you can find Evaluations of OpenSURF
% and the C# and C++ code. http://www.chrisevansdev.com/opensurf/
% Chris Evans gave me permisson to publish this code under the (Mathworks)
% BSD license.
%
% Ipts = OpenSurf(I, Options)
%
% inputs,
% I : The 2D input image color or greyscale
% (optional)
% Options : A struct with options (see below)
%
% outputs,
% Ipts : A structure with the information about all detected Landmark points
% Ipts.x , ipts.y : The landmark position
% Ipts.scale : The scale of the detected landmark
% Ipts.laplacian : The laplacian of the landmark neighborhood
% Ipts.orientation : Orientation in radians
% Ipts.descriptor : The descriptor for corresponding point matching
%
% options,
% Options.verbose : If set to true then useful information is
% displayed (default false)
% Options.upright : Boolean which determines if we want a non-rotation
% invariant result (default false)
% Options.extended : Add extra landmark point information to the
% descriptor (default false)
% Options.tresh : Hessian response treshold (default 0.0002)
% Options.octaves : Number of octaves to analyse(default 5)
% Options.init_sample : Initial sampling step in the image (default 2)
%
% Example 1, Basic Surf Point Detection
% % Load image
% I=imread(’TestImages/test.png’);
% % Set this option to true if you want to see more information
% Options.verbose=false;
% % Get the Key Points
% Ipts=OpenSurf(I,Options);
% % Draw points on the image
% PaintSURF(I, Ipts);
%
% Add subfunctions to Matlab Search path
functionname=’OpenSurf.m’; %函數(shù)名字
functiondir=which(functionname);%which()找出函數(shù)與文件所在的目錄名
functiondir=functiondir(1:end-length(functionname));
addpath([functiondir ’/SubFunctions’])
% Process inputs
defaultoptions=struct(’tresh’,0.0002,’octaves’,5,’init_sample’,2,’upright’,false,’extended’,false,’verbose’,false);
if(~exist(’Options’,’var’)),
Options=defaultoptions;
else
tags = fieldnames(defaultoptions);
for i=1:length(tags)
if(~isfield(Options,tags{i})), Options.(tags{i})=defaultoptions.(tags{i}); end
end
if(length(tags)~=length(fieldnames(Options))),
warning(’register_volumes:unknownoption’,’unknown options found’);
end
end
% Create Integral Image創(chuàng)建積分圖像
img=IntegralImage_IntegralImage(img);
% Extract the interest points提取興趣點(diǎn)
FastHessianData.thresh = Options.tresh;
FastHessianData.octaves = Options.octaves;
FastHessianData.init_sample = Options.init_sample;
FastHessianData.img = img;
ipts = FastHessian_getIpoints(FastHessianData,Options.verbose);
% Describe the interest points描述興趣點(diǎn)
if(~isempty(ipts))
ipts = SurfDescriptor_DecribeInterestPoints(ipts,Options.upright, Options.extended, img, Options.verbose);%調(diào)用描述特征點(diǎn)子程序SurfDescriptor_DecribeInterestPoints
end
3 運(yùn)行結(jié)果
4 參考文獻(xiàn)
[1]楊海燕, 羅文超, and 劉國棟. "基于SURF算法和SC-RANSAC算法的圖像配準(zhǔn)." 計(jì)算機(jī)應(yīng)用研究 30.5(2013):3.
[2]高素青, 譚勛軍, 黃承夏. 一種基于SURF的圖像配準(zhǔn)改進(jìn)算法[J]. 解放軍理工大學(xué)學(xué)報(bào):自然科學(xué)版, 2013, 14(4):5.
博主簡介:擅長 智能優(yōu)化算法 、 神經(jīng)網(wǎng)絡(luò)預(yù)測 、 信號處理 、 元胞自動機(jī) 、 圖像處理 、 路徑規(guī)劃 、 無人機(jī) 、 雷達(dá)通信 、 無線傳感器 等多種領(lǐng)域的Matlab仿真,相關(guān)matlab代碼問題可私信交流。
部分理論引用網(wǎng)絡(luò)文獻(xiàn),若有侵權(quán)聯(lián)系博主刪除。
-
2023年各省最新電價(jià)一覽!8省中午執(zhí)行谷段電價(jià)! 2023-01-03
-
PPT導(dǎo)出高分辨率圖片的四種方法 2022-09-22
-
全國消防救援總隊(duì)主官及簡歷(2023.2) 2023-02-10
-
盤點(diǎn) l 中國石油大慶油田現(xiàn)任領(lǐng)導(dǎo)班子 2023-02-28
-
我們的前輩!歷屆全國工程勘察設(shè)計(jì)大師完整名單! 2022-11-18
-
關(guān)于某送變電公司“4·22”人身死亡事故的快報(bào) 2022-04-26
