{"id":1979,"date":"2014-02-05T17:32:42","date_gmt":"2014-02-05T17:32:42","guid":{"rendered":"https:\/\/www.anagram.at\/en\/diplomarbeit\/3d-reconstruction\/"},"modified":"2014-02-05T17:32:42","modified_gmt":"2014-02-05T17:32:42","slug":"3d-reconstruction","status":"publish","type":"page","link":"https:\/\/www.anagram.at\/en\/diplomarbeit\/3d-reconstruction\/","title":{"rendered":"3D Reconstruction"},"content":{"rendered":"<p><body><br \/>\n<!--Navigation Panel--><br \/>\n<b> Next:<\/b> <a name=\"tex2html437\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/summary\/\">Summary<\/a><br \/>\n<b> Up:<\/b> <a name=\"tex2html433\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/stereo-vision\/\">Stereo Vision<\/a><br \/>\n<b> Previous:<\/b> <a name=\"tex2html427\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/feature-based-correspondence-analysis\/\">Feature-based Correspondence Analysis<\/a><br \/>\n<!--End of Navigation Panel--><\/p>\n<h1><a name=\"SECTION00350000000000000000\"\/><a name=\"3drec\"\/><\/p>\n<p>3D Reconstruction<br \/>\n<\/h1>\n<p>\nAfter the calibration is done and corresponding features in both images are found, the 3D position of the feature can be computed. With an intensity based approach a dense disparity map can be generated. A feature-based approach only provides disparity information for the features that have been extracted. Interpolation can be used to get more 3D points. The mathematical formulation to get the coordinates of an image point in the camera coordinate system<a name=\"tex2html21\" href=\"footnode.html#foot689\"><sup>2.4<\/sup><\/a> is given by\n<\/p>\n<p\/>\n<div align=\"CENTER\"><!-- MATH\n begin{equation}\nbegin{aligned}\n\t\tZ_c = -ffrac{b}{d} \n\t\tX_c = frac{-xz}{f} \n\t\tY_c = frac{-yz}{f}\nend{aligned}\nend{equation}\n --><\/p>\n<table cellpadding=\"0\" width=\"100%\" align=\"CENTER\">\n<tr valign=\"MIDDLE\">\n<td nowrap=\"nowrap\" align=\"CENTER\"><img loading=\"lazy\" width=\"85\" height=\"151\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img167.png\" alt=\"begin{equation*}begin{aligned}Z_c = -ffrac{b}{d}  X_c = frac{-xz}{f}  Y_c = frac{-yz}{f} end{aligned}end{equation*}\"\/><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\nwhere <img loading=\"lazy\" width=\"16\" height=\"35\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img14.png\" alt=\"$ f$\"\/> is the effective focal length and <img loading=\"lazy\" width=\"13\" height=\"20\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img13.png\" alt=\"$ b$\"\/> is the baseline, both parameters can be computed using a calibration technique. If <img loading=\"lazy\" width=\"19\" height=\"33\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img168.png\" alt=\"$ t_1$\"\/> is the translation vector of the left camera and <img loading=\"lazy\" width=\"19\" height=\"33\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img169.png\" alt=\"$ t_2$\"\/> is the calibration vector of the second camera, the baseline <img loading=\"lazy\" width=\"13\" height=\"20\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img13.png\" alt=\"$ b$\"\/> can be computed by subtracting the <img loading=\"lazy\" width=\"15\" height=\"19\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img25.png\" alt=\"$ x$\"\/> coordinates of the translation vectors. <\/p>\n<p\/>\n<div align=\"CENTER\"><a name=\"SV:baseline\"\/><!-- MATH\n begin{equation}\nb = t_2{_x} - t_1{_x}\nend{equation}\n --><\/p>\n<table cellpadding=\"0\" width=\"100%\" align=\"CENTER\">\n<tr valign=\"MIDDLE\">\n<td nowrap=\"nowrap\" align=\"CENTER\"><img loading=\"lazy\" width=\"106\" height=\"35\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img170.png\" alt=\"$displaystyle b = t_2{_x} - t_1{_x}$\"\/><\/td>\n<td nowrap=\"nowrap\" width=\"10\" align=\"RIGHT\">\n(2.36)<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\nFor many applications it is more convenient to use coordinates of the object points given in another coordinate system. To get a rotation matrix and a translation vector, which are both needed to relate two coordinate system to each other, calibration is used. The extrinsic camera parameters define the orientation and translation of the camera coordinate system in reference to a given world coordinate system, which originates at the calibration pattern. To formulate the relation between the two camera  coordinate system, let us introduce a new one, the so-called cyclopean view. This coordinate system has its origin in the middle of the baseline <img loading=\"lazy\" width=\"13\" height=\"20\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img13.png\" alt=\"$ b$\"\/>, so that the z-axis bisects the angle between the left and right optical axes, as illustrated in Figure <a href=\"#stereoimggeo\">2.14<\/a>.<\/p>\n<div align=\"CENTER\"><a name=\"stereoimggeo\"\/><a name=\"708\"\/><\/p>\n<table>\n<caption align=\"BOTTOM\"><strong>Figure 2.14:<\/strong><br \/>\nCyclopean view bisects the angle between the left and right optical axes<\/caption>\n<tr>\n<td>\n<div align=\"CENTER\">\n <img loading=\"lazy\" width=\"266\" height=\"269\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/stereoimggeo.jpg\" alt=\"Image stereoimggeo\"\/><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>The angle between the optical axes is 2<img loading=\"lazy\" width=\"16\" height=\"35\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img171.png\" alt=\"$ phi$\"\/>. The y-axis of the camera coordinate system has to be parallel. The relation between a point <!-- MATH\n $P = (X,Y,Z)$\n --><br \/>\n<img loading=\"lazy\" width=\"118\" height=\"37\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img36.png\" alt=\"$ P=(X,Y,Z)$\"\/> in the cyclopean coordinate system, and the same point <!-- MATH\n $P_l(X_l,Y_l,Z_l),P_r(X_r,Y_r,Z_r)$\n --><br \/>\n<img loading=\"lazy\" width=\"227\" height=\"37\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img172.png\" alt=\"$ P_l(X_l,Y_l,Z_l),P_r(X_r,Y_r,Z_r)$\"\/> can be written as<\/p>\n<p\/>\n<div align=\"CENTER\"><!-- MATH\n begin{equation}\nbegin{pmatrix}\nX_l cr Y_l cr Z_l cr\nend{pmatrix} =\nbegin{pmatrix}\ncosphi & 0 & sinphi cr\n0 & 1 & 0 cr\n-sinphi & 0 & cosphi\nend{pmatrix}  \nbegin{pmatrix}\nX + frac{b}{2} - fsinphi cr\nY cr\nZ\nend{pmatrix} \nend{equation}\n --><\/p>\n<table cellpadding=\"0\" width=\"100%\" align=\"CENTER\">\n<tr valign=\"MIDDLE\">\n<td nowrap=\"nowrap\" align=\"CENTER\"><img loading=\"lazy\" width=\"415\" height=\"115\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img173.png\" alt=\"$displaystyle begin{pmatrix}X_l cr Y_l cr Z_l cr end{pmatrix} = begin{pma...&#10;...d{pmatrix} begin{pmatrix}X + frac{b}{2} - fsinphi cr Y cr Z end{pmatrix}$\"\/><\/td>\n<td nowrap=\"nowrap\" width=\"10\" align=\"RIGHT\">\n(2.37)<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\nand<\/p>\n<p\/>\n<div align=\"CENTER\"><!-- MATH\n begin{equation}\nbegin{pmatrix}\nX_l cr Y_l cr Z_l\nend{pmatrix} =\nbegin{pmatrix}\ncosphi &  0 & -sinphi cr\n0 & 1 & 0 cr\nsinphi & 0 & cosphi\nend{pmatrix}  \nbegin{pmatrix}\nX + frac{b}{2} + fsinphi cr\nY cr\nZ\nend{pmatrix} \nend{equation}\n --><\/p>\n<table cellpadding=\"0\" width=\"100%\" align=\"CENTER\">\n<tr valign=\"MIDDLE\">\n<td nowrap=\"nowrap\" align=\"CENTER\"><img loading=\"lazy\" width=\"415\" height=\"115\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img174.png\" alt=\"$displaystyle begin{pmatrix}X_l cr Y_l cr Z_l end{pmatrix} = begin{pmatrix...&#10;...d{pmatrix} begin{pmatrix}X + frac{b}{2} + fsinphi cr Y cr Z end{pmatrix}$\"\/><\/td>\n<td nowrap=\"nowrap\" width=\"10\" align=\"RIGHT\">\n(2.38)<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\nTo get the coordinates of point <!-- MATH\n $P_w(X_w,Y_w,Z_w)$\n --><br \/>\n<img loading=\"lazy\" width=\"130\" height=\"37\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img175.png\" alt=\"$ P_w(X_w,Y_w,Z_w)$\"\/> in world coordinates, after the coordinates of point <!-- MATH\n $P_c(X_C,Y_c,Z_c)$\n --><br \/>\n<img loading=\"lazy\" width=\"118\" height=\"37\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img176.png\" alt=\"$ P_c(X_C,Y_c,Z_c)$\"\/> has been computed,  we can use Equation <a href=\"node9.html#scenetoimage\">2.13<\/a> to formulate the following equation<\/p>\n<p\/>\n<div align=\"CENTER\"><!-- MATH\n begin{equation}\nbegin{pmatrix}\nX_w cr Y_w cr Z_w\nend{pmatrix} =\n   left(\n    begin{array}{ccc}\n        r_1 & r_2 & r_3  \n        r_4 & r_5 & r_6   \n        r_7 & r_8 & r_9\n    end{array}right)^{-1}\n\tbegin{pmatrix}\n\t\tX_c - T_xcr Y_c - T_ycr Z_c - T_c\n\tend{pmatrix}\nend{equation}\n --><\/p>\n<table cellpadding=\"0\" width=\"100%\" align=\"CENTER\">\n<tr valign=\"MIDDLE\">\n<td nowrap=\"nowrap\" align=\"CENTER\"><img loading=\"lazy\" width=\"338\" height=\"123\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img177.png\" alt=\"$displaystyle begin{pmatrix}X_w cr Y_w cr Z_w end{pmatrix} = left( begin{...&#10;...y}right)^{-1} begin{pmatrix}X_c - T_xcr Y_c - T_ycr Z_c - T_c end{pmatrix}$\"\/><\/td>\n<td nowrap=\"nowrap\" width=\"10\" align=\"RIGHT\">\n(2.39)<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\nTransforming the camera coordinate system into another one is useful when the camera is not oriented in an appropriate manner. Additionally, the coordinate system can be shared amongst different applications with different camera systems.<\/p>\n<hr\/>\n<p><!--Navigation Panel--><b> Next:<\/b> <a name=\"tex2html437\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/summary\/\">Summary<\/a><br \/>\n<b> Up:<\/b> <a name=\"tex2html433\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/stereo-vision\/\">Stereo Vision<\/a><br \/>\n<!--End of Navigation Panel--><\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>3D Reconstruction<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1946,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":""},"categories":[],"featured_image_src":null,"featured_image_src_square":null,"_links":{"self":[{"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/pages\/1979"}],"collection":[{"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/comments?post=1979"}],"version-history":[{"count":0,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/pages\/1979\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/pages\/1946"}],"wp:attachment":[{"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/media?parent=1979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/categories?post=1979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}