{"id":1968,"date":"2014-02-05T17:32:44","date_gmt":"2014-02-05T17:32:44","guid":{"rendered":"https:\/\/www.anagram.at\/en\/diplomarbeit\/search-for-corresponding-lines\/"},"modified":"2014-02-05T17:32:44","modified_gmt":"2014-02-05T17:32:44","slug":"search-for-corresponding-lines","status":"publish","type":"page","link":"https:\/\/www.anagram.at\/en\/diplomarbeit\/search-for-corresponding-lines\/","title":{"rendered":"Search for corresponding lines"},"content":{"rendered":"<p><body><br \/>\n<!--Navigation Panel--><br \/>\n<b> Next:<\/b> <a name=\"tex2html543\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/object-detection\/\">Object detection<\/a><br \/>\n<b> Up:<\/b> <a name=\"tex2html539\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/correspondence-analysis-2\/\">Correspondence Analysis<\/a><br \/>\n<b> Previous:<\/b> <a name=\"tex2html533\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/correspondence-analysis-2\/\">Correspondence Analysis<\/a><br \/>\n<!--End of Navigation Panel--><\/p>\n<h2><a name=\"SECTION00451000000000000000\"\/> <a name=\"M_linesearch\"\/><\/p>\n<p>Search for corresponding lines<br \/>\n<\/h2>\n<p>\nAfter the line lists for both images are generated, the <i>correspondence problem<\/i> needs to be solved. In contrast to an intensity-based correspondence analysis, there is no need to have a maximum disparity limit because all the lines are compared and thus all possible disparities are taken into consideration. But a constraint, that a line which is nearer than another is more likely to be chosen than a line which is more far away, has to be inserted. This constraint is needed, because if there are two objects mapped with approximately the same y-coordinate and approximately the same line properties, e.g. the same length, attitude and midpoint, as it is if two robots are next to each other, the left border of the robot could be matched with the left border of the other robot. Figure <a href=\"#corr_problem\">3.12<\/a> depicts this situation.<\/p>\n<div align=\"CENTER\"><a name=\"corr_problem\"\/><a name=\"1727\"\/><\/p>\n<table>\n<caption align=\"BOTTOM\"><strong>Figure 3.12:<\/strong><br \/>\nLine ambiguity, the left image shows the merged original images (the alpha value of the right image has been decreased) and the right image shows the line ambiguity if no constraint is inserted<\/caption>\n<tr>\n<td>\n<div align=\"CENTER\">\n <\/div>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>To avoid matching of two opposite lines, the gradient direction is taken into consideration. Figure <a href=\"#corr_problem\">3.12<\/a> shows the gradient direction for the left edge image (depicted as red arrows in the electronic version of this thesis at the top and bottom). To measure the similarity between two lines, the  weighted sum of the difference between the attitude <img loading=\"lazy\" width=\"17\" height=\"19\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img47.png\" alt=\"$ alpha$\"\/> , the direction <img loading=\"lazy\" width=\"14\" height=\"20\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img183.png\" alt=\"$ theta$\"\/>, the length <img loading=\"lazy\" width=\"14\" height=\"33\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img231.png\" alt=\"$ g$\"\/> and the difference in the y-coordinate between the start and end point <img loading=\"lazy\" width=\"46\" height=\"33\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img232.png\" alt=\"$ p_s,p_e$\"\/> of the line is computed. Let <img loading=\"lazy\" width=\"9\" height=\"19\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img233.png\" alt=\"$ '$\"\/> denote a line inside the right image, then the rating <img loading=\"lazy\" width=\"14\" height=\"19\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img161.png\" alt=\"$ r$\"\/> of a line <img loading=\"lazy\" width=\"11\" height=\"20\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img7.png\" alt=\"$ l$\"\/> can be formulated as<\/p>\n<p\/>\n<div align=\"CENTER\"><!-- MATH\n begin{equation}\nr(l,l') = w_{pos}arrowvert p_s- p_s' arrowvert +w_{pos}arrowvert p_e- p_e' arrowvert + w_{alpha} (alpha-alpha') + w_g (g-g') + w_{theta} (theta - theta')\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=\"621\" height=\"39\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img234.png\" alt=\"$displaystyle r(l,l') = w_{pos}arrowvert p_s- p_s' arrowvert +w_{pos}arrowve...&#10;...vert + w_{alpha} (alpha-alpha') + w_g (g-g') + w_{theta} (theta - theta')$\"\/><\/td>\n<td nowrap=\"nowrap\" width=\"10\" align=\"RIGHT\">\n(3.15)<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\nwhere <img loading=\"lazy\" width=\"38\" height=\"33\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img235.png\" alt=\"$ w_{pos}$\"\/>, <!-- MATH\n $w_{alpha}$\n --><br \/>\n<img loading=\"lazy\" width=\"27\" height=\"33\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img236.png\" alt=\"$ w_{alpha}$\"\/>, <img loading=\"lazy\" width=\"26\" height=\"33\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img237.png\" alt=\"$ w_g$\"\/> and <!-- MATH\n $w_{theta}$\n --><br \/>\n<img loading=\"lazy\" width=\"25\" height=\"33\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img238.png\" alt=\"$ w_{theta}$\"\/> are weights, that define the importance of the line property. The currently implemented method uses <!-- MATH\n $(0.5, 200, 0.1, 0)$\n --><br \/>\n<img loading=\"lazy\" width=\"129\" height=\"37\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img239.png\" alt=\"$ (0.5, 200, 0.1, 0)$\"\/> as <img loading=\"lazy\" width=\"18\" height=\"17\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img240.png\" alt=\"$ Vec{w}$\"\/>.<br \/>\nA line <img loading=\"lazy\" width=\"11\" height=\"20\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img7.png\" alt=\"$ l$\"\/> corresponds to a line <img loading=\"lazy\" width=\"15\" height=\"17\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img8.png\" alt=\"$ l'$\"\/>, if<\/p>\n<ul>\n<li>the rating <img loading=\"lazy\" width=\"53\" height=\"37\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img241.png\" alt=\"$ r(l,l')$\"\/> is smaller than the best rating achieved, thus (<!-- MATH\n $forall x arrowvert r(l,l') leq r(l,x)$\n --><br \/>\n<img loading=\"lazy\" width=\"153\" height=\"37\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img242.png\" alt=\"$ forall x arrowvert r(l,l') leq r(l,x)$\"\/>) must hold.\n<\/li>\n<li>the x-coordinate of the compare point in the left image is greater than the x-coordinate of the compare point in the right image\n<\/li>\n<li>the y-coordinate of the intersection between the horizontal line which has its origin in the left compare point and the line in the right image lies inside this line.\n<\/li>\n<li>the rating <img loading=\"lazy\" width=\"14\" height=\"19\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img161.png\" alt=\"$ r$\"\/> is below a given threshold\n<\/li>\n<li>the calculated disparity between the two lines is smaller than the maximum disparity allowed\n<\/li>\n<li>the difference of the gradient direction <!-- MATH\n $theta-theta'$\n --><br \/>\n<img loading=\"lazy\" width=\"51\" height=\"38\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img243.png\" alt=\"$ theta-theta'$\"\/> is below a given threshold\n<\/li>\n<\/ul>\n<p>During the search for corresponding lines, every line  inside the left image is compared with every line inside the right image. The lines with the best rating are considered as corresponding lines. If two lines fulfill the constraints mentioned above, the lines are removed from the list of possible candidates. To avoid false matches, the rating has to be smaller than a given threshold. If two corresponding lines with disparity <img loading=\"lazy\" width=\"14\" height=\"20\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img33.png\" alt=\"$ d$\"\/> have been found, a horizontal line of length <img loading=\"lazy\" width=\"14\" height=\"20\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img33.png\" alt=\"$ d$\"\/> is inserted in the left image. It has its origin in the midpoint of the left line and if the right line would be inserted into the left image, the compare point would be the end point of the line.<\/p>\n<hr\/>\n<p><!--Navigation Panel--><b> Next:<\/b> <a name=\"tex2html543\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/object-detection\/\">Object detection<\/a><br \/>\n<b> Up:<\/b> <a name=\"tex2html539\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/correspondence-analysis-2\/\">Correspondence Analysis<\/a><br \/>\n<!--End of Navigation Panel--><\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Search for corresponding lines<\/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\/1968"}],"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=1968"}],"version-history":[{"count":0,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/pages\/1968\/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=1968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/categories?post=1968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}