使用R确定度量约束的运动的简单正交结构

时间:2016-06-07 23:30:42

标签: r opencv image-processing non-linear-regression structure-from-motion

根据Tomasi和Kanade [1992],我想从运动程序构建一个简单的结构。该文章可以在下面找到:

https://people.eecs.berkeley.edu/~yang/courses/cs294-6/papers/TomasiC_Shape%20and%20motion%20from%20image%20streams%20under%20orthography.pdf

这种方法看似优雅而简单,但是,我无法计算上述参考文献的方程式16中概述的度量约束

我正在使用R,并概述了我迄今为止的工作:

给出一组图像

enter image description here

我想跟踪三个橱柜门的角落和一张照片(图像上的黑点)。首先,我们将这些点读作矩阵w,其中

w

最终,我们希望将w分解为描述3维点的旋转矩阵R和形状矩阵S.我将尽可能多地提供详细信息,但可以从Tomasi和Kanade [1992]论文中收集完整的数学描述。

我在下面提供w:

w.vector=c(0.2076,0.1369,0.1918,0.1862,0.1741,0.1434,0.176,0.1723,0.2047,0.233,0.3593,0.3668,0.3744,0.3593,0.3876,0.3574,0.3639,0.3062,0.3295,0.3267,0.3128,0.2811,0.2979,0.2876,0.2782,0.2876,0.3838,0.3819,0.3819,0.3649,0.3913,0.3555,0.3593,0.2997,0.3202,0.3137,0.31,0.2718,0.2895,0.2867,0.825,0.7703,0.742,0.7251,0.7232,0.7138,0.7345,0.6911,0.1937,0.1248,0.1723,0.1741,0.1657,0.1313,0.162,0.1657,0.8834,0.8118,0.7552,0.727,0.7364,0.7232,0.7288,0.6892,0.4309,0.3798,0.4021,0.3965,0.3844,0.3546,0.3695,0.3583,0.314,0.3065,0.3989,0.3876,0.3857,0.3781,0.3989,0.3593,0.5184,0.4849,0.5147,0.5193,0.5109,0.4812,0.4979,0.4849,0.3536,0.3517,0.4121,0.3951,0.3951,0.3781,0.397,0.348,0.5175,0.484,0.5091,0.5147,0.5128,0.4784,0.4905,0.4821,0.7722,0.7326,0.7326,0.7232,0.7232,0.7119,0.7402,0.7006,0.4281,0.3779,0.3918,0.3863,0.3825,0.3472,0.3611,0.3537,0.8043,0.7628,0.7458,0.7288,0.727,0.7213,0.7364,0.6949,0.5789,0.5491,0.5761,0.5817,0.5733,0.5444,0.5537,0.5379,0.3649,0.3536,0.4177,0.3951,0.3857,0.3819,0.397,0.3461,0.697,0.671,0.6821,0.6821,0.6719,0.6412,0.6468,0.6235,0.3744,0.3649,0.4159,0.3819,0.3781,0.3612,0.3763,0.314,0.7008,0.6691,0.6794,0.6812,0.6747,0.6393,0.6412,0.6235,0.7571,0.7345,0.7439,0.7496,0.7402,0.742,0.7647,0.7213,0.5817,0.5463,0.5696,0.5779,0.5761,0.5398,0.551,0.5398,0.7665,0.7326,0.7439,0.7345,0.7288,0.727,0.7515,0.7062,0.8301,0.818,0.8571,0.8878,0.8766,0.8561,0.858,0.8394,0.4121,0.3876,0.4347,0.397,0.38,0.3631,0.3668,0.2971,0.912,0.8962,0.9185,0.939,0.9259,0.898,0.8887,0.8571,0.3989,0.3781,0.4215,0.3725,0.3612,0.3461,0.3423,0.2782,0.9092,0.8952,0.9176,0.9399,0.925,0.8971,0.8887,0.8571,0.4743,0.4536,0.4894,0.4517,0.446,0.4328,0.4385,0.3706,0.8273,0.8171,0.8571,0.8878,0.8766,0.8543,0.8561,0.8394,0.4743,0.4554,0.4969,0.4668,0.4536,0.4404,0.4536,0.3857)

w=matrix(w.vector,ncol=16,nrow=16,byrow=FALSE)

然后根据等式2创建注册的测量矩阵wm

equation 2

通过

wm = w - rowMeans(w)

我们可以将wm分解为' 2FxP'矩阵o1一个对角线' PxP'矩阵e和' PxP'矩阵o2使用奇异值分解。

svdwm <- svd(wm)

o1 <- svdwm$u
e <-  diag(svdwm$d)
o2 <- t(svdwm$v) ## dont forget the transpose!

但是,由于噪音问题,我们只关注o1的前3列,e的前3个值和o2的前3行:

o1p <- svdwm$u[,1:3]
ep <-  diag(svdwm$d[1:3])
o2p <- t(svdwm$v)[1:3,] ## dont forget the transpose!

现在我们可以在等式(14)

中求解rhatshat

equation 14

通过

rhat <- o1p%*%ep^(1/2)
shat <- ep^(1/2) %*% o2p

然而,这些结果并不是唯一的,我们仍然需要通过等式(15)求解R和S

equation 15

通过使用等式(16)的度量约束

equation 16

现在我需要找Q.我相信有两种可能的方法,但目前还不清楚如何使用。

方法1 涉及求解B B=Q%*%solve(Q)然后使用Cholesky分解来找到Q.方法1似乎是文献中的常见选择,但是,如何提供的细节很少实际解决线性系统。很明显,B是一个&#39; 3x3&#39; 6个未知数的对称矩阵。然而,考虑到度量约束(等式16),我不知道如何在给定3个等式的情况下求解6个未知数。我忘记了对称矩阵的属性吗?

方法II 涉及使用非线性方法来估计Q,并且在运动文献的结构中不太常用。

有人可以就如何解决这个问题提出一些建议吗?在此先感谢,如果我需要在我的问题中更清楚,请告诉我。

1 个答案:

答案 0 :(得分:1)

i^f可以写为{a_if b_if c_if}

j^f可以写为{a_jf b_jf c_jf}

Q可以写为{{q11,q12,q13}{q12,q22,q23}{q13,q23,q33}}

所以我们的等式是:

所以第一个等式可以写成:


相当于

为了简短起见我们现在定义:

(我知道间距非常小,但是,这是一个Vector ......)

因此,对于所有不同帧f中的所有方程,我们可以写出一个大的等式:

(抱歉丑陋的公式......) 现在你只需要使用Cholesky分解或任何......

来解决QQ^T - Matrix