forked from alexandervakhitov/uncertain-pnp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
epnpuf_pnpu.m
18 lines (17 loc) · 821 Bytes
/
epnpuf_pnpu.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function [R_est, t_est] = epnpuf_pnpu(X, x, K, Sigmas3D, Sigmas2D, R_est_3, t_est_3, mode, mode2)
mode = 2;
if mode2 == 1
[Sigmas3D, sigmas3d] = replace_with_trace(Sigmas3D);
[Sigmas2D, sigmas2d] = replace_with_trace(Sigmas2D);
end
n = size(X, 2);
x3d_h = [X' ones(n,1)];
x2d_h = [x' ones(n, 1)];
%function [R,T,Xc,best_solution,opt]=efficient_pnpu_gauss(x3d_h,x2d_h,A,Sigmas3D,Sigmas2D,Rest,test,is_pca)
if mode2 == 1
[R_est,t_est,Xc,best_solution,opt]=efficient_pnpu_gauss_fast(x3d_h,x2d_h,K,sigmas3d, sigmas2d, R_est_3, t_est_3);
else
[R_est,t_est,Xc,best_solution,opt]=efficient_pnpu_gauss(x3d_h,x2d_h,K,Sigmas3D, Sigmas2D, R_est_3, t_est_3, true);
end
[R_est, t_est] = add_solution(R_est, t_est, R_est_3, t_est_3);
end