遵循Hartley / Zisserman的Multiview Geometry,算法12:最佳三角剖分方法(p318),我得到了相应的图像点xhat1和xhat2(步骤10)。在步骤11中,需要计算3D点Xhat。一种这样的方法是直接线性变换(DLT),在12.2(p312)和4.1(p88)中提到。
[同质方法(DLT),p312-313指出,它找到了一个解决方案,作为与A的最小奇异值相对应的单位奇异矢量,]]
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.');
但是,A是一个16x1的矩阵,导致Va为1x1。
获得3D点时我做错了什么(和修复)?
关于其有价值的示例数据:
算法中第xi节的工作代码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
更新
% 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
遵循Hartley / Zisserman的Multiview Geometry,算法12:最佳三角剖分方法(p318),我得到了相应的图像点xhat1和xhat2(步骤10)。在步骤11中,需要...
正如书中提到的(第12.2节),p
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,:));