{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal " -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 3 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "" 0 259 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 260 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE " " 0 261 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 259 "" 0 "" {TEXT -1 58 "P3P - Absolute Camera Po se Problem\nT. Pajdla, Z. Kukelova " }}{PARA 260 "" 0 "" {TEXT -1 23 " pajdla@cmp.felk.cvut.cz" }}{PARA 261 "" 0 "" {TEXT -1 12 "30 Nov 2009 \+ " }}}{EXCHG }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 104 "restart:\nwith (ListTools):\nwith(LinearAlgebra):\nwith(Student[LinearAlgebra]):\nwit h(Groebner):\nDigits:=10:" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 1 " " } {TEXT 256 11 "P3P Problem" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 9 "The ca lib" }{MPLTEXT 1 0 0 "" }{TEXT -1 709 "rated perspective camera observ es three poins X1_w, X2_w, X3_w along rays with direction \nvectors x1 _c, x2_c, x3_c. Vectors X1_w, X2_w, X3_w are written w.r.t. the world \+ cartesian coordinate \nsystem. Vectors x1_c, x2_c, x3_c are written w. r.t. the camera cartesian cordinate system. There exist \nmultipliers d1, d2, d3, for which \n\n X1_c = d1 x1_c, \n X2_c = d2 x2_c, \n \+ X3_c = d3 x3_c. \n\nSince both sytems are cartesian, we get three e quations in three variables d1, d2, d3 of degree two\n\nD12 = ||X1_w - X2_w||^2 = ||X1_c - X2_x||^2 = ||d1 x1_c - d2 x2_c ||^2\nD23 = ||X2_w - X3_w||^2 = ||X2_c - X3_x||^2 = ||d1 x1_c - d2 x2_c ||^2\nD31 = ||X3 _w - X1_w||^2 = ||X3_c - X1_x||^2 = ||d1 x1_c - d2 x2_c ||^2\n" }} {PARA 0 "" 0 "" {TEXT -1 45 "which we can solve for multiplieds d1, d2 , d3" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "Sumulation" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 21 "Known points in space" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "X1_w:=<0,0,0>;\nX2_w:=<1,0,0>;\nX3_w:=<0,1, 0>; \n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%X1_wG-%'RTABLEG6%\"*+\"4Z 9-%'MATRIXG6#7%7#\"\"!F-F-&%'VectorG6#%'columnG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%X2_wG-%'RTABLEG6%\"*wqFX\"-%'MATRIXG6#7%7#\"\"\"7#\" \"!F/&%'VectorG6#%'columnG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%X3_wG -%'RTABLEG6%\"*o4IX\"-%'MATRIXG6#7%7#\"\"!7#\"\"\"F-&%'VectorG6#%'colu mnG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "their squared distances" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 113 "D12:=DotProduct(X1_w-X2_w ,X1_w-X2_w);\nD23:=DotProduct(X2_w-X3_w,X2_w-X3_w);\nD31:=DotProduct(X 3_w-X1_w,X3_w-X1_w);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$D12G\"\"\" " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$D23G\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$D31G\"\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 76 "S imulate the camera with center C and the rotation matrix R using your \+ IRON:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "C_w:=<0,0,1>;\nIRO N:=20;\nR_cw:= convert(RotationMatrix(IRON*Pi/60, <1/3,1,-1/7>),Matrix );" }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 21 "Ray directio n vectors" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 122 "x1_c := R_cw. (X1_w - C_w): d1_c:=simplify(sqrt(DotProduct(x1_c,x1_c))); x1_c:=simpl ify(x1_c/d1_c);\nx2_c := ...\nx3_c := ..." }}{PARA 11 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "Form the 3 equations fo r d1, d2, d3" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 22 "Compute Groebner Bases" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "GB1:= Basis(...);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 46 "Compute the solutions via the companion matrix" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "sd1:= ...\nsd2:= ...\nsd3:= \+ ..." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 38 "Select the right solution \+ on distances" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "Sd:=" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "Find the camera center by intersec ting three spheres" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 87 "sq1:= DotProduct(-X1_w,-X1_w,conjugate=false)-Sd[1]^2;\nsq2:=. ..;\nsq3:=...;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "Compute the gro ebner basis" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "GB:=Basis([s q1,sq2,sq3],plex(z,y,x));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 42 "Get \+ the solutions via the companion matrix" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "cs:= ..." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 18 "Choos e the right C" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "Cs:= ..." } {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 72 "Construct vectors from the computed camera center to the three 3D points" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "X:= ..." }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 42 "Normalize columns of X to get unit vector s" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 107 "X:=;" }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 63 "Construct the matrix with columns from camera direction vectors" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "x:= ...;" }{TEXT -1 0 "" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "Find R by solving x = R X" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "R := ..." }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 25 "Check that it is correct." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "R_cw-R;" }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{MARK "2 0 0 " 0 }{VIEWOPTS 1 1 0 3 4 1802 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 } {RTABLE_HANDLES 144709100 145277076 145300968 }{RTABLE M7R0 I6RTABLE_SAVE/144709100X*%)anythingG6"6"[gl!#%!!!"$"$""!F'F'6" } {RTABLE M7R0 I6RTABLE_SAVE/145277076X*%)anythingG6"6"[gl!#%!!!"$"$"""""!F(6" } {RTABLE M7R0 I6RTABLE_SAVE/145300968X*%)anythingG6"6"[gl!#%!!!"$"$""!"""F'6" }