-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfcvp.m
40 lines (36 loc) · 978 Bytes
/
fcvp.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function [fcv]=fcvp(xv,yv,inlp,ina,inc,pntx,pnty)
% FCVP
% FAUCCAL supporting function that calculates
% A matrix and dl vector factors for vanish
% points estimation using vanish line
% (without radial distortion estimation)
switch inlp(1)
case 1
if inc~=0
fcv(1)=inc*inlp(2)-1;
fcv(2)=inc*xv;
fcv(3)=inc;
fcv(4)=inlp(2)*xv+inlp(3)-pnty;
fcv(5)=pntx-xv-inc*pnty+inc*inlp(2)*xv+inc*inlp(3);
else
fcv(1)=ina-inlp(2);
fcv(2)=-xv;
fcv(3)=-1;
fcv(4)=xv-pntx;
fcv(5)=pnty-inlp(2)*xv-inlp(3)+ina*(xv-pntx);
end
case 2
if inc~=0
fcv(1)=inc-inlp(2);
fcv(2)=-yv;
fcv(3)=-1;
fcv(4)=yv-pnty;
fcv(5)=pntx-inlp(2)*yv-inlp(3)+inc*(yv-pnty);
else
fcv(1)=ina*inlp(2)-1;
fcv(2)=ina*yv;
fcv(3)=ina;
fcv(4)=inlp(2)*yv+inlp(3)-pntx;
fcv(5)=pnty-yv-ina*pntx+ina*inlp(2)*yv+ina*inlp(3);
end
end