三角测量直接线性变换 [英] Triangulation & Direct linear transform

查看:211
本文介绍了三角测量直接线性变换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Hartley / Zisserman的Multiview Geometery,算法12:最佳三角测量方法(p318)之后,我得到相应的图像点xhat1和xhat2(步骤10)。在步骤11中,需要计算3D点Xhat。一种这样的方法是在12.2(p312)和4.1(p88)中提及的直接线性变换(DLT)。



同质方法(DLT),p312-313,声明它找到一个解作为对应于A的最小奇异值的单位奇异向量, p>

  A = [xhat1(1)* P1(3,:)' 
xhat1(2)* P1(3,:)' - P1(2,:)'
xhat2(1)* P2(3,:)' - P2(1,:)'
xhat2(2)* P2(3,:)' - P2(2,:)'

[Ua Ea Va] = svd(A);
Xhat = Va(:,end);

plot3(Xhat(1),Xhat(2),Xhat(3),'r。

但是,A是一个16x1矩阵,导致Va为1x1。



我在做3D点时做错了什么(和修正)?



对于其值得取样数据:

  xhat1 = 

1.0e + 009 *

4.9973
-0.2024
0.0027


xhat2 =

1.0e + 011 *

2.0729
2.6624
0.0098


P1 =

699.6674 0 392.1170 0
0 701.6136 304.0275 0
0 0 1.0000 0


P2 =

1.0e + 003 *

-0.7845 0.0508 -0.1592 1.8619
-0.1379 0.7338 0.1649 0.6825
- 0.0006 0.0001 0.0008 0.0010


A =< - 我的计算

1.0e + 011 *

-0.0000
0
0.0500
0
0
-0.0000
-0.0020
0
-1.3369
0.2563
1.5634
2.0729
-1.7170
0.3292
2.0079
2.6624


$ b b

更新。算法中第xi部分的工作代码

 %xi 
= [xhat1(1)* P1(3,:) - P1(1,:);
xhat1(2)* P1(3,:) - P1(2,:);
xhat2(1)* P2(3,:) - P2(1,:);
xhat2(2)* P2(3,:) - P2(2,:)];

A(1,:) = A(1,:) / norm(A(1,:));
A(2,:) = A(2,:) / norm(A(2,:));
A(3,:) = A(3,:) / norm(A(3,:));
A(4,:) = A(4,:) / norm(A(4,:));

[Ua Ea Va] = svd(A);
X = Va(:,end);
X = X / X(4); %3D点


解决方案

12.2)中, P p i T P1(k,:)(即正确的公式为 A = [xhat1(1)* P1 3,:) - P1(1,:); ... )。



我希望这只是一个拼写错误。 >

此外,建议使用其二级规范对 A 的每一行进行规范化,即所有 i



A(i,:) = A(i, ));



如果你想绘制三角形3D点,你必须标准化 Xhat Xhat = Xhat / Xhat(4); 在绘图之前(无意义无效),即


Following Hartley/Zisserman's Multiview Geometery, Algorithm 12: The optimal triangulation method (p318), I got the corresponding image points xhat1 and xhat2 (step 10). In step 11, one needs to compute the 3D point Xhat. One such method is Direct Linear Transform (DLT), mentioned in 12.2 (p312) and 4.1 (p88).

The homogenous method (DLT), p312-313, states that it finds a solution as the unit singular vector corresponding to the smallest singular value of A, thus,

A = [xhat1(1) * P1(3,:)' - P1(1,:)' ;
      xhat1(2) * P1(3,:)' - P1(2,:)' ;
      xhat2(1) * P2(3,:)' - P2(1,:)' ;
      xhat2(2) * P2(3,:)' - P2(2,:)' ];

[Ua Ea Va] = svd(A);
Xhat = Va(:,end);

plot3(Xhat(1),Xhat(2),Xhat(3), 'r.');

However, A is a 16x1 matrix, resulting in a Va that is 1x1.

What am I doing wrong (and a fix) in getting the 3D point?

For what its worth sample data:

xhat1 =

  1.0e+009 *

    4.9973
   -0.2024
    0.0027


xhat2 =

  1.0e+011 *

    2.0729
    2.6624
    0.0098


P1 =

  699.6674         0  392.1170         0
         0  701.6136  304.0275         0
         0         0    1.0000         0


P2 =

  1.0e+003 *

   -0.7845    0.0508   -0.1592    1.8619
   -0.1379    0.7338    0.1649    0.6825
   -0.0006    0.0001    0.0008    0.0010


A =    <- my computation

  1.0e+011 *

   -0.0000
         0
    0.0500
         0
         0
   -0.0000
   -0.0020
         0
   -1.3369
    0.2563
    1.5634
    2.0729
   -1.7170
    0.3292
    2.0079
    2.6624

Update Working code for section xi in algorithm

% xi
A = [xhat1(1) * P1(3,:) - P1(1,:) ;
     xhat1(2) * P1(3,:) - P1(2,:) ;
     xhat2(1) * P2(3,:) - P2(1,:) ;
     xhat2(2) * P2(3,:) - P2(2,:) ];

A(1,:) = A(1,:)/norm(A(1,:));
A(2,:) = A(2,:)/norm(A(2,:));
A(3,:) = A(3,:)/norm(A(3,:));
A(4,:) = A(4,:)/norm(A(4,:));

[Ua Ea Va] = svd(A);
X = Va(:,end);
X = X / X(4);   % 3D Point

解决方案

As is mentioned in the book (sec 12.2), pi T are the rows of P. Therefore, you don't need to transpose P1(k,:) (i.e. the right formulation is A = [xhat1(1) * P1(3,:) - P1(1,:) ; ...).

I hope that was just a typo.

Additionally, it is recommended to normalize each row of A with its L2 norm, i.e. for all i

A(i,:) = A(i,:)/norm(A(i,:));

And if you want to plot the triangulated 3D points, you have to normalize Xhat before plotting (its meaningless otherwise), i.e.

Xhat = Xhat/Xhat(4);

这篇关于三角测量直接线性变换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆