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

  • 大小: 71KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-19
  • 語言: 其他
  • 標簽: harris角點??ransac??

資源簡介

利用harris算法提取角點,ncc進行匹配,最后使用ransac算法刪除錯誤匹配點

資源截圖

代碼片段和文件信息

function?[F?inliers]?=?FindFund(x1?x2?t?feedback)

????if?~all(size(x1)==size(x2))
????????error(‘Data?sets?x1?and?x2?must?have?the?same?dimension‘);
????end
????
????if?nargin?==?3
feedback?=?0;
????end
????
????[rowsnpts]?=?size(x1);
????if?rows~=2?&?rows~=3
????????error(‘x1?and?x2?must?have?2?or?3?rows‘);
????end
????
????if?rows?==?2????%?Pad?data?with?homogeneous?scale?factor?of?1
????????x1?=?[x1;?ones(1npts)];
????????x2?=?[x2;?ones(1npts)];????????
????end
????
????%?Normalise?each?set?of?points?so?that?the?origin?is?at?centroid?and
????%?mean?distance?from?origin?is?sqrt(2).??
????[x1?T1]?=?normalise(x1);
????[x2?T2]?=?normalise(x2);

????s?=?8;??%?8-point
????
????fittingfn?=?@fundmatrix;
????distfn????=?@funddist;
????degenfn???=?@isdegenerate;
????[F?inliers]?=ransac([x1;?x2]?fittingfn?distfn?degenfn?s?t?feedback);
????%do?a?final?least?squares?fit?on?the?data?points?
????F?=?fundmatrix(x1(:inliers)?x2(:inliers));?
????%?Denormalise
????F?=?T2‘*F*T1;
??%check?if?is?degenerated??
function?r?=?isdegenerate(x)
????r?=?0;?
????
%?Function?to?evaluate?Sampson?distance?of?the?fit?of?a?fundamental?matrix
%?with?respect?to?a??set?of?matched?points?as?needed?by?RANSAC.???
????function?[bestInliers?bestFV_ar]?=?funddist(F?x?t);
????
????x1?=?x(1:3:);????%?Extract?x1?and?x2?from?x
????x2?=?x(4:6:);
????
????
????if?iscell(F)??%?several?solutions?each?of?which?must?be?tested
??
nF?=?length(F);???%?Number?of?solutions?to?test
bestF?=?F{1};?????%?Initial?allocation?of?best?solution
ninliers?=?0;?????%?Number?of?inliers

for?k?=?1:nF
????x2tFx1?=?zeros(1length(x1));
????for?n?=?1:length(x1)
x2tFx1(n)?=?x2(:n)‘*F{k}*x1(:n);
????end
????
????Fx1?=?F{k}*x1;
????Ftx2?=?F{k}‘*x2;?????

????%?Evaluate?distances
????d?=??x2tFx1.^2?./?...
?(Fx1(1:).^2?+?Fx1(2:).^2?+?Ftx2(1:).^2?+?Ftx2(2:).^2);
????
????inliers?=?find(abs(d)??????????????????????????????????????????
????
????if?length(inliers)?>?ninliers???%?Record?best?solution
ninliers?=?length(inliers);
bestF?=?F{k};
bestInliers?=?inliers;
????end
end
????
????else?????%?We?just?have?one?solution
x2tFx1?=?zeros(1length(x1));
for?n?=?1:length(x1)
????x2tFx1(n)?=?x2(:n)‘*F*x1(:n);
end

????
Fx1?=?F*x1;
Ftx2?=?F‘*x2;?????

%?Evaluate?distances
d?=??x2tFx1.^2?./?...
?????(Fx1(1:).^2?+?Fx1(2:).^2?+?Ftx2(1:).^2?+?Ftx2(2:).^2);
?????bestInliers=find(abs(x2tFx1)?????bestF?=?F;????
????if(size(bestInliers2)<4)
????????V_ar=1;
????else
V_ar=var(x2tFx1(:bestInliers‘));
?????end
????end
????%?computes?fundamental?matrix?from?8?or?more?points
function?[Fe1e2]?=?fundmatrix(varargin)
????
????[x1?x2?npts]?=?validate(varargin(:));
????Octave?=?exist(‘OCTAVE_VERSION‘)?~=?0;
????%?Normalise?each?set?of?points?so?that?the?origin?
????[x1?T1]?=?normalise(x1);
????[x2?T2]?=?normalise(x2);
?

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????3694??2012-03-29?15:44??zhisong_chen_project3\FindFund.m

?????文件???????2711??2012-03-22?15:54??zhisong_chen_project3\harris.m

?????文件??????37750??2012-03-22?15:14??zhisong_chen_project3\im1.jpg

?????文件??????38250??2012-03-22?15:15??zhisong_chen_project3\im2.jpg

?????文件???????1973??2012-03-29?15:58??zhisong_chen_project3\main.m

?????文件???????1699??2012-03-29?15:35??zhisong_chen_project3\NCC.m

?????文件???????1133??2012-03-29?14:15??zhisong_chen_project3\normalise.m

?????文件???????2460??2012-03-29?15:44??zhisong_chen_project3\ransac.m

?????文件????????739??2012-03-22?18:17??zhisong_chen_project3\validate.m

?????目錄??????????0??2012-04-21?17:01??zhisong_chen_project3

-----------?---------??----------?-----??----

????????????????90409????????????????????10


評論

共有 條評論