Transformation of projection matrices computed from the trifocal tensor for estimating three-dimensional points

I use this legacy code: http://fossies.org/dox/opencv-2.4.8/trifocal_8cpp_source.html  to evaluate three-dimensional points from the data of the corresponding two-dimensional points from 3 different points of view. The problem I am facing is the same as stated here: http://opencv-users.1802565.n2.nabble.com/trifocal-tensor-icvComputeProjectMatrices6Points-icvComputeProjectMatricesNPoints-td2423108.html

I can successfully calculate Projection matrices using icvComputeProjectMatrices6Points . I used 6 sets of corresponding points from 3 types. The results are shown below:

projMatr1 P1 = 
[-0.22742541, 0.054754492, 0.30500898, -0.60233182;
  -0.14346679, 0.034095913, 0.33134204, -0.59825808;
  -4.4949986e-05, 9.9166318e-06, 7.106331e-05, -0.00014547621]

projMatr2 P2 = 
[-0.17060626, -0.0076031247, 0.42357284, -0.7917347;
  -0.028817834, -0.0015948272, 0.2217239, -0.33850163;
  -3.3046148e-05, -1.3680664e-06, 0.0001002633, -0.00019192585]

projMatr3 P3 = 
[-0.033748217, 0.099119112, -0.4576003, 0.75215244;
  -0.001807699, 0.0035084449, -0.24180284, 0.39423448;
  -1.1765103e-05, 2.9554356e-05, -0.00013438619, 0.00025332544]

, 3D-, icvReconstructPointsFor3View. :

4D points = 
[-0.4999997, -0.26867214, -1, 2.88633e-07, 1.7766099e-07, -1.1447386e-07;
  -0.49999994, -0.28693244, 3.2249036e-06, 1, 7.5971762e-08, 2.1956141e-07;
  -0.50000024, -0.72402155, 1.6873783e-07, -6.8603946e-08, -1, 5.8393886e-07;
  -0.50000012, -0.56681377, 1.202426e-07, -4.1603233e-08, -2.3659911e-07, 1]

3D- :

   - { ID:1,X:500.000000, Y:800.000000, Z:3000.000000}
   - { ID:2,X:500.000000, Y:800.000000, Z:4000.000000}
   - { ID:3,X:1500.000000, Y:800.000000, Z:4000.000000}
   - { ID:4,X:1500.000000, Y:800.000000, Z:3000.000000}
   - { ID:5,X:500.000000, Y:1800.000000, Z:3000.000000}
   - { ID:6,X:500.000000, Y:1800.000000, Z:4000.000000}

: P1, P2 P3 , ? , .

+4
1

, , , . X0_j P0_i , , Xp_j = inv(H).X0_j Pp_i = P0_i.H 4x4 H, .

, . (, ) (. OpenCV), . 7.4.5 ", ", .Ressl (PDF).

, 3D- , (, 3D-).

:

: P1, P2, P3 ( , P1=[I|0]), K1, K2, K3 x1, x2, x3.

: P1_E, P2_E, P3_E ( ).

  • P1_E=K1.[I|0]

  • F21, F31. P2=[A|a] P3=[B|b], F21=[a]x.A F31=[b]x.B (. 9.1 [HZ00]), 3x1 e [e]x = [0,-e_3,e_2;e_3,0,-e_1;-e_2,e_1,0]

  • E21 = K2'.F21.K1 E31 = K3'.F31.K1

  • i = 2,3

    . SVD Ei1=U.S.V'. det(U)<0 U=-U. det(V)<0 V=-V.

    II. W=[0,-1,0;1,0,0;0,0,1], Ri=U.W.V' ti = third column of U

    III. M=[Ri'.ti]x, X1=M.inv(K1).x1 Xi=M.Ri'.inv(Ki).xi

    IV. X1_3.Xi_3<0, Ri=U.W'.V' M X1

    v. X1_3<0 ti = -ti

    VI. Pi_E=Ki.[Ri|ti]

  • , t3 ( , ||t2||=1): โ€‹โ€‹

    . p2=R2'.inv(K2).x2 p3=R3'.inv(K3).x3

    II. M=[p2]x

    III. s=(p3'.M.R2'.t2)/(p3'.M.R3'.t3)

    IV. t3=t3*s

  • : P1_E, P2_E, P3_E (, ).

[HZ00] " ", . ., 2000 .

+8

Source: https://habr.com/ru/post/1527307/


All Articles