CalibratedCamera.nb 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. (* Content-type: application/vnd.wolfram.mathematica *)
  2. (*** Wolfram Notebook File ***)
  3. (* http://www.wolfram.com/nb *)
  4. (* CreatedBy='Mathematica 8.0' *)
  5. (*CacheID: 234*)
  6. (* Internal cache information:
  7. NotebookFileLineBreakTest
  8. NotebookFileLineBreakTest
  9. NotebookDataPosition[ 157, 7]
  10. NotebookDataLength[ 11408, 362]
  11. NotebookOptionsPosition[ 10747, 334]
  12. NotebookOutlinePosition[ 11102, 350]
  13. CellTagsIndexPosition[ 11059, 347]
  14. WindowFrame->Normal*)
  15. (* Beginning of Notebook Content *)
  16. Notebook[{
  17. Cell["\<\
  18. The derivative of CalibratedCamera.project:\
  19. \>", "Text",
  20. CellChangeTimes->{{3.5349648356912127`*^9, 3.534964846480523*^9}, {
  21. 3.534983100980744*^9, 3.534983101484686*^9}}],
  22. Cell[CellGroupData[{
  23. Cell[BoxData[
  24. RowBox[{"H1", "=",
  25. RowBox[{
  26. RowBox[{
  27. RowBox[{
  28. FractionBox["1", "z"],
  29. RowBox[{
  30. RowBox[{"(", GridBox[{
  31. {"1", "0",
  32. RowBox[{
  33. RowBox[{"-", "x"}], "/", "z"}]},
  34. {"0", "1",
  35. RowBox[{
  36. RowBox[{"-", "y"}], "/", "z"}]}
  37. }], ")"}], ".",
  38. RowBox[{"(", GridBox[{
  39. {"0",
  40. RowBox[{"-", "z"}], "y",
  41. RowBox[{"-", "1"}], "0", "0", "R00", "R10", "R20"},
  42. {"z", "0",
  43. RowBox[{"-", "x"}], "0",
  44. RowBox[{"-", "1"}], "0", "R01", "R11", "R21"},
  45. {
  46. RowBox[{"-", "y"}], "x", "0", "0", "0",
  47. RowBox[{"-", "1"}], "R02", "R12", "R22"}
  48. }], ")"}]}]}], "//", "FullSimplify"}], "//",
  49. "MatrixForm"}]}]], "Input",
  50. CellChangeTimes->{{3.5349631885090446`*^9, 3.5349632390951033`*^9}, {
  51. 3.53496344228561*^9, 3.534963552777855*^9}, {3.53496365487344*^9,
  52. 3.53496369917972*^9}, 3.534963801932398*^9, {3.5349638327702837`*^9,
  53. 3.534963833842349*^9}, {3.5349638684957743`*^9, 3.534963869306225*^9}, {
  54. 3.5349640018609343`*^9, 3.534964073635954*^9}, {3.534964139661661*^9,
  55. 3.534964141597094*^9}, {3.534964228457883*^9, 3.534964230497267*^9}, {
  56. 3.534964522693956*^9, 3.534964554934105*^9}, 3.534979649216166*^9, {
  57. 3.534979703414953*^9, 3.5349797245266523`*^9}, 3.534979754875834*^9, {
  58. 3.5349801268943996`*^9, 3.534980128188809*^9}, {3.534981330976294*^9,
  59. 3.5349813327600317`*^9}, 3.534981567474765*^9, {3.534982081101321*^9,
  60. 3.534982107106247*^9}, {3.534982164393888*^9, 3.534982164510919*^9}, {
  61. 3.534982374683118*^9, 3.534982376464725*^9}}],
  62. Cell[BoxData[
  63. TagBox[
  64. RowBox[{"(", "\[NoBreak]", GridBox[{
  65. {
  66. FractionBox[
  67. RowBox[{"x", " ", "y"}],
  68. SuperscriptBox["z", "2"]],
  69. RowBox[{
  70. RowBox[{"-", "1"}], "-",
  71. FractionBox[
  72. SuperscriptBox["x", "2"],
  73. SuperscriptBox["z", "2"]]}],
  74. FractionBox["y", "z"],
  75. RowBox[{"-",
  76. FractionBox["1", "z"]}], "0",
  77. FractionBox["x",
  78. SuperscriptBox["z", "2"]],
  79. FractionBox[
  80. RowBox[{
  81. RowBox[{
  82. RowBox[{"-", "R02"}], " ", "x"}], "+",
  83. RowBox[{"R00", " ", "z"}]}],
  84. SuperscriptBox["z", "2"]],
  85. FractionBox[
  86. RowBox[{
  87. RowBox[{
  88. RowBox[{"-", "R12"}], " ", "x"}], "+",
  89. RowBox[{"R10", " ", "z"}]}],
  90. SuperscriptBox["z", "2"]],
  91. FractionBox[
  92. RowBox[{
  93. RowBox[{
  94. RowBox[{"-", "R22"}], " ", "x"}], "+",
  95. RowBox[{"R20", " ", "z"}]}],
  96. SuperscriptBox["z", "2"]]},
  97. {
  98. RowBox[{"1", "+",
  99. FractionBox[
  100. SuperscriptBox["y", "2"],
  101. SuperscriptBox["z", "2"]]}],
  102. RowBox[{"-",
  103. FractionBox[
  104. RowBox[{"x", " ", "y"}],
  105. SuperscriptBox["z", "2"]]}],
  106. RowBox[{"-",
  107. FractionBox["x", "z"]}], "0",
  108. RowBox[{"-",
  109. FractionBox["1", "z"]}],
  110. FractionBox["y",
  111. SuperscriptBox["z", "2"]],
  112. FractionBox[
  113. RowBox[{
  114. RowBox[{
  115. RowBox[{"-", "R02"}], " ", "y"}], "+",
  116. RowBox[{"R01", " ", "z"}]}],
  117. SuperscriptBox["z", "2"]],
  118. FractionBox[
  119. RowBox[{
  120. RowBox[{
  121. RowBox[{"-", "R12"}], " ", "y"}], "+",
  122. RowBox[{"R11", " ", "z"}]}],
  123. SuperscriptBox["z", "2"]],
  124. FractionBox[
  125. RowBox[{
  126. RowBox[{
  127. RowBox[{"-", "R22"}], " ", "y"}], "+",
  128. RowBox[{"R21", " ", "z"}]}],
  129. SuperscriptBox["z", "2"]]}
  130. },
  131. GridBoxAlignment->{
  132. "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}},
  133. "RowsIndexed" -> {}},
  134. GridBoxSpacings->{"Columns" -> {
  135. Offset[0.27999999999999997`], {
  136. Offset[0.7]},
  137. Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
  138. Offset[0.2], {
  139. Offset[0.4]},
  140. Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}],
  141. Function[BoxForm`e$,
  142. MatrixForm[BoxForm`e$]]]], "Output",
  143. CellChangeTimes->{
  144. 3.534979650069955*^9, {3.534979704654621*^9, 3.5349797249719963`*^9},
  145. 3.534979755407372*^9, 3.534980128803479*^9, 3.534981333789564*^9,
  146. 3.5349815682066193`*^9, 3.534982108180704*^9, 3.534982166031692*^9,
  147. 3.534982377250555*^9}]
  148. }, Open ]],
  149. Cell["\<\
  150. To get rid of (1/z) factors, work in terms of u=x/z and v=x/z.\
  151. \>", "Text",
  152. CellChangeTimes->{{3.534981922219325*^9, 3.534981963212936*^9}, {
  153. 3.534983115196439*^9, 3.534983121940318*^9}}],
  154. Cell[CellGroupData[{
  155. Cell[BoxData[
  156. RowBox[{"H2", "=",
  157. RowBox[{
  158. RowBox[{
  159. RowBox[{
  160. RowBox[{
  161. FractionBox["1", "z"],
  162. RowBox[{
  163. RowBox[{"(", GridBox[{
  164. {"1", "0",
  165. RowBox[{
  166. RowBox[{"-", "x"}], "/", "z"}]},
  167. {"0", "1",
  168. RowBox[{
  169. RowBox[{"-", "y"}], "/", "z"}]}
  170. }], ")"}], ".",
  171. RowBox[{"(", GridBox[{
  172. {"0",
  173. RowBox[{"-", "z"}], "y",
  174. RowBox[{"-", "1"}], "0", "0", "R00", "R10", "R20"},
  175. {"z", "0",
  176. RowBox[{"-", "x"}], "0",
  177. RowBox[{"-", "1"}], "0", "R01", "R11", "R21"},
  178. {
  179. RowBox[{"-", "y"}], "x", "0", "0", "0",
  180. RowBox[{"-", "1"}], "R02", "R12", "R22"}
  181. }], ")"}]}]}], "/.",
  182. RowBox[{"{",
  183. RowBox[{
  184. RowBox[{"x", "\[Rule]",
  185. RowBox[{"z", " ", "u"}]}], ",",
  186. RowBox[{"y", "\[Rule]",
  187. RowBox[{"z", " ", "v"}]}]}], "}"}]}], "//", "FullSimplify"}], "//",
  188. "MatrixForm", " "}]}]], "Input",
  189. CellChangeTimes->{{3.534981575562448*^9, 3.534981660163035*^9}, {
  190. 3.534981699433219*^9, 3.534981715884362*^9}, {3.534981811953741*^9,
  191. 3.534981812758938*^9}, {3.534981967549185*^9, 3.534981970084591*^9}, {
  192. 3.5349821168936243`*^9, 3.5349821229726763`*^9}, {3.5349821691614027`*^9,
  193. 3.534982169838853*^9}, {3.5349823818506517`*^9, 3.5349823882411737`*^9}, {
  194. 3.534982418562274*^9, 3.534982445450313*^9}, {3.5349824987688103`*^9,
  195. 3.5349825453911533`*^9}}],
  196. Cell[BoxData[
  197. TagBox[
  198. RowBox[{"(", "\[NoBreak]", GridBox[{
  199. {
  200. RowBox[{"u", " ", "v"}],
  201. RowBox[{
  202. RowBox[{"-", "1"}], "-",
  203. SuperscriptBox["u", "2"]}], "v",
  204. RowBox[{"-",
  205. FractionBox["1", "z"]}], "0",
  206. FractionBox["u", "z"],
  207. FractionBox[
  208. RowBox[{"R00", "-",
  209. RowBox[{"R02", " ", "u"}]}], "z"],
  210. FractionBox[
  211. RowBox[{"R10", "-",
  212. RowBox[{"R12", " ", "u"}]}], "z"],
  213. FractionBox[
  214. RowBox[{"R20", "-",
  215. RowBox[{"R22", " ", "u"}]}], "z"]},
  216. {
  217. RowBox[{"1", "+",
  218. SuperscriptBox["v", "2"]}],
  219. RowBox[{
  220. RowBox[{"-", "u"}], " ", "v"}],
  221. RowBox[{"-", "u"}], "0",
  222. RowBox[{"-",
  223. FractionBox["1", "z"]}],
  224. FractionBox["v", "z"],
  225. FractionBox[
  226. RowBox[{"R01", "-",
  227. RowBox[{"R02", " ", "v"}]}], "z"],
  228. FractionBox[
  229. RowBox[{"R11", "-",
  230. RowBox[{"R12", " ", "v"}]}], "z"],
  231. FractionBox[
  232. RowBox[{"R21", "-",
  233. RowBox[{"R22", " ", "v"}]}], "z"]}
  234. },
  235. GridBoxAlignment->{
  236. "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}},
  237. "RowsIndexed" -> {}},
  238. GridBoxSpacings->{"Columns" -> {
  239. Offset[0.27999999999999997`], {
  240. Offset[0.7]},
  241. Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
  242. Offset[0.2], {
  243. Offset[0.4]},
  244. Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}],
  245. Function[BoxForm`e$,
  246. MatrixForm[BoxForm`e$]]]], "Output",
  247. CellChangeTimes->{
  248. 3.534981661750978*^9, {3.534981700471121*^9, 3.5349817167574883`*^9},
  249. 3.534981813153152*^9, 3.5349819705942793`*^9, {3.534982117522484*^9,
  250. 3.534982124251252*^9}, 3.534982170293386*^9, 3.534982388956635*^9,
  251. 3.534982446240321*^9, {3.534982502305121*^9, 3.534982546180998*^9}}]
  252. }, Open ]],
  253. Cell["Finally, avoid divides.", "Text",
  254. CellChangeTimes->{{3.534983093980698*^9, 3.5349831123126383`*^9}}],
  255. Cell[CellGroupData[{
  256. Cell[BoxData[
  257. RowBox[{"H2", "/.",
  258. RowBox[{"{",
  259. RowBox[{
  260. RowBox[{"1", "/", "z"}], "\[Rule]", "d"}], "}"}]}]], "Input",
  261. CellChangeTimes->{{3.534982548021124*^9, 3.534982548331835*^9}}],
  262. Cell[BoxData[
  263. TagBox[
  264. RowBox[{"(", "\[NoBreak]", GridBox[{
  265. {
  266. RowBox[{"u", " ", "v"}],
  267. RowBox[{
  268. RowBox[{"-", "1"}], "-",
  269. SuperscriptBox["u", "2"]}], "v",
  270. RowBox[{"-", "d"}], "0",
  271. RowBox[{"d", " ", "u"}],
  272. RowBox[{"d", " ",
  273. RowBox[{"(",
  274. RowBox[{"R00", "-",
  275. RowBox[{"R02", " ", "u"}]}], ")"}]}],
  276. RowBox[{"d", " ",
  277. RowBox[{"(",
  278. RowBox[{"R10", "-",
  279. RowBox[{"R12", " ", "u"}]}], ")"}]}],
  280. RowBox[{"d", " ",
  281. RowBox[{"(",
  282. RowBox[{"R20", "-",
  283. RowBox[{"R22", " ", "u"}]}], ")"}]}]},
  284. {
  285. RowBox[{"1", "+",
  286. SuperscriptBox["v", "2"]}],
  287. RowBox[{
  288. RowBox[{"-", "u"}], " ", "v"}],
  289. RowBox[{"-", "u"}], "0",
  290. RowBox[{"-", "d"}],
  291. RowBox[{"d", " ", "v"}],
  292. RowBox[{"d", " ",
  293. RowBox[{"(",
  294. RowBox[{"R01", "-",
  295. RowBox[{"R02", " ", "v"}]}], ")"}]}],
  296. RowBox[{"d", " ",
  297. RowBox[{"(",
  298. RowBox[{"R11", "-",
  299. RowBox[{"R12", " ", "v"}]}], ")"}]}],
  300. RowBox[{"d", " ",
  301. RowBox[{"(",
  302. RowBox[{"R21", "-",
  303. RowBox[{"R22", " ", "v"}]}], ")"}]}]}
  304. },
  305. GridBoxAlignment->{
  306. "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}},
  307. "RowsIndexed" -> {}},
  308. GridBoxSpacings->{"Columns" -> {
  309. Offset[0.27999999999999997`], {
  310. Offset[0.7]},
  311. Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
  312. Offset[0.2], {
  313. Offset[0.4]},
  314. Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}],
  315. Function[BoxForm`e$,
  316. MatrixForm[BoxForm`e$]]]], "Output",
  317. CellChangeTimes->{3.534982550241898*^9}]
  318. }, Open ]]
  319. },
  320. WindowSize->{740, 752},
  321. WindowMargins->{{44, Automatic}, {-4, Automatic}},
  322. FrontEndVersion->"8.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (October 5, \
  323. 2011)",
  324. StyleDefinitions->"Default.nb"
  325. ]
  326. (* End of Notebook Content *)
  327. (* Internal cache information *)
  328. (*CellTagsOutline
  329. CellTagsIndex->{}
  330. *)
  331. (*CellTagsIndex
  332. CellTagsIndex->{}
  333. *)
  334. (*NotebookFileOutline
  335. Notebook[{
  336. Cell[557, 20, 184, 4, 26, "Text"],
  337. Cell[CellGroupData[{
  338. Cell[766, 28, 1644, 38, 61, "Input"],
  339. Cell[2413, 68, 2645, 85, 85, "Output"]
  340. }, Open ]],
  341. Cell[5073, 156, 201, 4, 26, "Text"],
  342. Cell[CellGroupData[{
  343. Cell[5299, 164, 1487, 40, 80, "Input"],
  344. Cell[6789, 206, 1860, 55, 75, "Output"]
  345. }, Open ]],
  346. Cell[8664, 264, 107, 1, 26, "Text"],
  347. Cell[CellGroupData[{
  348. Cell[8796, 269, 195, 5, 27, "Input"],
  349. Cell[8994, 276, 1737, 55, 63, "Output"]
  350. }, Open ]]
  351. }
  352. ]
  353. *)
  354. (* End of internal cache information *)