EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
未定义函数或变量 "pt11"。 出错 features_matching (line 14)+ k0 W6 j# W8 B+ E
[B1,IX] = sort(pt11(:,1)); 出错 tuxiangpingjie (line 34)& t, _* F2 p [3 j
[pt1,pt2]= features_matching( db, desc2, dist_ratio , pos1 , pos2); features_matching 程序2 c& ]: z7 r1 f& m x3 w: _' C
function [pt1,pt2] = features_matching( database, desc, dist_ratio , pos1 , pos2 )$ x0 o- u# Z9 x7 i; B# G* i s2 A
num = 1;
/ N& m$ ~% t5 v; X1 q- u- T! afor k = 1:size(desc,1)" q& y4 I6 f# v, w
dist = sqrt(sum((database.desc - repmat(desc(k, ,size(database.desc,1),1)).^2,2));
, r3 _, Y8 ^/ H/ K8 ~# q- E[B,IX] = sort(dist);5 j0 W: o8 K0 D- `. f" L& [( u
if B(1)/B(2) >= dist_ratio %nn2_dist >= dist_ratio
1 F% ^' I1 a7 t% cidx = 0;
0 E( b0 W5 a$ g- N# A3 Celse
+ w( K- _5 M; |pt22(num, = pos2(k, ;
( _0 Q3 l8 P; gpt11(num,:) = pos1(IX(1),:);
! F# ~7 m4 T. d7 x0 t/ [num = num + 1;
, N+ I0 S9 k1 E) Z+ j. }end: F" f3 v% ]# G7 A) m% X2 K8 ^3 N' N, v
end
9 w+ K8 f8 Z5 m# F; p! x- w6 p[B1,IX] = sort(pt11(:,1));- E- V9 ]# i$ y: l( \: E1 k
Pt1 = pt11(IX,:);
9 f4 x" x) K9 C" {Pt2 = pt22(IX,:);: L1 C# K8 L0 E8 E! ?0 N
; q3 H+ l( B; D6 Hk = 1;
* |# B& T5 v; G: Sfor i = 2:num-1
' ~ D0 M" @# o# E2 t- C" ] sDist = sqrt((Pt1(i,1) - Pt1(i-1,1))^2 +(Pt1(i,2) - Pt1(i-1,2))^2);* M$ O! y: `3 J4 I1 V8 y+ s: ~
if Dist > 3& E; L6 l, ?( }
pt1(k,:) = Pt1(i,:);" p1 J9 O7 q" V4 d5 U) i: w. k
pt2(k,:) = Pt2(i,:);' p+ R0 R! n+ |0 E2 m
k = k + 1;: M; n, @. {- s! F, Q: ^
end
5 R) C/ L8 \, n, S* L5 s0 gend [B1,IX] = sort(pt2(:,1));1 f' N! M" U" m o! i
Pt1 = pt1(IX,:);
; l; d5 [& d1 cPt2 = pt2(IX,:);
+ _0 E* E5 h# j+ k) g. b% H* {2 ^, t. a2 m
kk = 1;
0 ? W7 q3 f- _8 q- r. g. ypt1 = [];
, |; i5 i/ L9 n( ]/ G- xpt2 = [];
" F% O( b4 B! n7 J9 \. T6 W' Gfor i = 2:k-1: H5 a- o8 M5 i {; d
Dist = sqrt((Pt2(i,1) - Pt2(i-1,1))^2 +(Pt2(i,2) - Pt2(i-1,2))^2);
# Y! f' a A1 x t3 z5 E* Rif Dist > 3
8 y0 Y2 A, v+ ? npt1(kk,:) = Pt1(i,:);
5 p4 K! K% u. p3 {pt2(kk,:) = Pt2(i,:);$ h' ]4 m% X5 ~8 K8 x
kk = kk + 1;
* B5 R$ Z; O7 w6 O: Uend
4 U+ T( `' y+ U7 r7 nend ^4 a1 @" N9 a" c2 f* l' N2 m
, |) `5 Y, ]3 d9 @# [
' N1 S* Q9 C5 S! X |