{"id":2071,"date":"2015-05-08T00:00:58","date_gmt":"2015-05-08T07:00:58","guid":{"rendered":"http:\/\/192.168.3.4\/?p=2071"},"modified":"2018-01-09T06:50:24","modified_gmt":"2018-01-09T14:50:24","slug":"texture-mapping-from-video","status":"publish","type":"post","link":"https:\/\/www.cloudacm.com\/?p=2071","title":{"rendered":"Orthomosaic Mapping"},"content":{"rendered":"<p><strong>Introduction &#8211; Making some sense out of the mess of words<br \/>\n<\/strong><\/p>\n<p>The title is a bit of a misnomer since <a href=\"http:\/\/www.alaskamapped.org\/\" target=\"_blank\">orthomosaic mapping<\/a> has more to do images gathered perpendicular to the observed object, as in aerial photography.\u00a0 I decided to keep the title since the method for rendering of 3D objects from a group of two dimensional images is the same.\u00a0 Additionally, the basis of the rendering has roots in mapping relief.\u00a0 All though the title might be somewhat incorrect, the intent of mapping objects allows for some liberty with the verbiage.<\/p>\n<p><strong>Purpose &#8211; Getting more details from the data<\/strong><\/p>\n<p>I have posted before about 3D modeling.\u00a0 The reason I wanted to revisit the topic was because of the earlier process was cookie cut and highly dependent on cloud providers.\u00a0 AutoCAD&#8217;s <a href=\"http:\/\/www.123dapp.com\/catch\" target=\"_blank\">123D Catch<\/a> and Microsoft&#8217;s <a href=\"https:\/\/www.photosynth.net\/\" target=\"_blank\">Photosynth<\/a> provide impressive results for casual users.\u00a0 By uploading a series of images, the visual experience is quite revealing.\u00a0 However, there isn&#8217;t any granular control to the process.\u00a0 Having a one size fits all may induce limits.\u00a0 This is the reason I decided to go into detail using a standalone process.<\/p>\n<p>In this post, I&#8217;ll cover a step by step method to create texture maps from images using VisualSFM and Meshlab.\u00a0 Much of the work done here has been based on the examples giving at <a href=\"http:\/\/flightriot.com\/tutorials\/post-processing\/\" target=\"_blank\">flightriot.com<\/a>.\u00a0 I&#8217;ll also include some back ground on the software components as well as practical uses.<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/SHa_LBIzDac\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><strong>Details &#8211; From a group of images to a 3D object<\/strong><\/p>\n<p>First thing to do is get the programs that will be used to process and display the renderings.\u00a0 VisualSFM is the primary program that will process the two dimensional images and is available for <a href=\"http:\/\/ccwu.me\/vsfm\/\" target=\"_blank\">download here<\/a>.\u00a0 The next program is <a href=\"http:\/\/meshlab.sourceforge.net\/\" target=\"_blank\">Meshlab<\/a>.\u00a0 It is optional, but will allow renderings to be exported and it offers some visual advantages over VisualSFM.\u00a0 There are several online tutorials on the installation steps, so I won&#8217;t cover them here.<\/p>\n<p>There are requirements when gathering images of a subject.\u00a0 Imaging a subject has 3 field of view requirements when taking a series of images.\u00a0 The first option, the subject should be followed in a straight line, with the camera perpendicular to the subject and direction of motion.\u00a0 The second option, the camera should follow an arch with images taken of the subject from various angles.\u00a0 The last option, the camera should circle the subject and take images completely around it.<\/p>\n<p>If images do not follow these requirements, the rendering process is likely to fail.\u00a0 Also, images should be in the JPEG format.<\/p>\n<p>In this example, I took 10 pictures of Haystack Rock at Canon Beach, OR.\u00a0 I kept Haystack as the focal point of my subject and walked an arch around it.\u00a0 I attempted to take pictures at even points, but this was more guesswork and some spots were obstructed by beach goers.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2015\/05\/HaystackThumbs.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2241\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2015\/05\/HaystackThumbs.png\" alt=\"HaystackThumbs\" width=\"568\" height=\"321\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/HaystackThumbs.png 568w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/HaystackThumbs-300x170.png 300w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/HaystackThumbs-100x57.png 100w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/HaystackThumbs-150x85.png 150w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/HaystackThumbs-200x113.png 200w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/HaystackThumbs-450x254.png 450w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/a>The time of day and weather are a factor.\u00a0 The subject should be clear of clouds and free of glare from the sun.\u00a0 You want the images to be as clear of artifacts as possible.<\/p>\n<p>Using VisualSFM, I opened all of the image files that pertained to the subject.\u00a0 Once they loaded, I ran the Compute Missing Matches command in VisualSFM.\u00a0 Then I ran the Compute 3D Reconstruction command.\u00a0 Finally, I ran the CMVS Dense Reconstruction.<\/p>\n<p>Now the dense cloud object can be viewed inside VisualSFM.\u00a0 The data files generated can also be used to open the rendering inside Meshlab.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2015\/05\/snapshot02.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2245\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2015\/05\/snapshot02.png\" alt=\"snapshot02\" width=\"933\" height=\"637\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/snapshot02.png 933w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/snapshot02-300x205.png 300w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/snapshot02-100x68.png 100w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/snapshot02-150x102.png 150w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/snapshot02-200x137.png 200w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/snapshot02-450x307.png 450w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/snapshot02-600x410.png 600w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2015\/05\/snapshot02-900x614.png 900w\" sizes=\"auto, (max-width: 933px) 100vw, 933px\" \/><\/a><\/p>\n<p>From Meshlab, open the generated file with the ply extension.\u00a0 Meshlab has more features than I&#8217;ll cover here, so <a href=\"https:\/\/www.youtube.com\/channel\/UC70CKZQPj_ZAJ0Osrm6TyTg\" target=\"_blank\">go here<\/a> if you need more in regards to Meshlab.<\/p>\n<p><strong>Relations &#8211; Cloud sourced images<\/strong><\/p>\n<p>Using photos that are available on the web seems like well suited resource for 3D rendering.\u00a0 However, it presents some challenges.\u00a0 Successful renders use image sequences that follow a linear, circular, or semi circular pattern of motion.\u00a0 They also fair better when the light source is diffused and originates from a uniform point.\u00a0 In addition, objects that are transparent or have a high degree of reflection render poorly.\u00a0 All of these ideal conditions are absent when using cloud sourced images.\u00a0 This means the steps to render Haystack Rock would need to be changed accommodate the diverse image source.\u00a0 VisualSFM has many more features available to it, this is just a simple introduction to it.<\/p>\n<p><strong>Summary &#8211; Back through the 2 mile tunnel<\/strong><\/p>\n<p>One of the main reasons for me researching this topic was due to my interest in trail rides.\u00a0 There is bike trail here in the Seattle area that runs from North Bend through Snoqualmie Pass.\u00a0 On that route there is a tunnel that is 2 miles long.\u00a0 It&#8217;s quite an experience to travel through, but it has been closed on occasion due to failing debris.\u00a0 It was something about the surface changes over time that made mapping from a visual sensor the most easiest and cheapest way.<\/p>\n<p>In this post I covered 3D rendering using VisualSFM and MeshLab.\u00a0 The process is basic and grossly simplistic, this is meant to be an introduction to these methods.\u00a0 I also covered some basic image requirements that make the render possible.\u00a0 It&#8217;s my hope that this will help get you started on texture mapping and 3D rendering.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction &#8211; Making some sense out of the mess of words The title is a bit of a misnomer since orthomosaic mapping has more to do images gathered perpendicular to the observed object, as in aerial photography.\u00a0 I decided to keep the title since the method for rendering of 3D objects from a group of two dimensional images is the same.\u00a0 Additionally, the basis of the rendering has roots in mapping relief.\u00a0 All though the title might be somewhat incorrect,&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.cloudacm.com\/?p=2071\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,5,6,3],"tags":[],"class_list":["post-2071","post","type-post","status-publish","format-standard","hentry","category-computer-vision","category-iphone","category-raspberry-pi","category-rd"],"_links":{"self":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/2071","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2071"}],"version-history":[{"count":23,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/2071\/revisions"}],"predecessor-version":[{"id":2259,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/2071\/revisions\/2259"}],"wp:attachment":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}