{"id":2562,"date":"2016-10-17T00:00:58","date_gmt":"2016-10-17T07:00:58","guid":{"rendered":"http:\/\/192.168.3.4\/?p=2562"},"modified":"2018-01-09T06:51:14","modified_gmt":"2018-01-09T14:51:14","slug":"3d-rendering-from-facebook-videos","status":"publish","type":"post","link":"https:\/\/www.cloudacm.com\/?p=2562","title":{"rendered":"3D Rendering from Facebook Videos"},"content":{"rendered":"<p>First, source your video from facebook.\u00a0 I used a video shot from a motorbike of a structure on side of the road.\u00a0 It was from a post of a road trip in Indonesia by a fellow with my same name.\u00a0 The scene reminded me of my travels in the Southwest Pacific when I was younger.\u00a0 It looked like good material as a source for model rendering.<\/p>\n<p>For more information on the following steps, see this link for the details.\u00a0 I referenced it when creating capturing the video source.\u00a0 See link &#8211; <a href=\"https:\/\/www.youtube.com\/watch?v=Y1kD8_ZEWRM\">https:\/\/www.youtube.com\/watch?v=Y1kD8_ZEWRM<\/a><\/p>\n<p>Steps to capture video posted on Facebook for processing.<\/p>\n<p>1. First of visit the video page on Facebook and copy the URL of the video.<\/p>\n<p>2. Now what you need to do is change above URL to the mobile version URL. All you need to do is switch &#8220;www&#8221; with &#8220;m&#8221;.<\/p>\n<p>3. Open mobile URL on a new page, play video and then pause.<\/p>\n<p>4. Make right click on video and you will get the option &#8220;Save video as&#8221;.<\/p>\n<p>Now we can extract the frames from the video to create individual images that will be used as our modeling source.\u00a0 To do this I ran the following command after creating a destination folder to contain the extracted frames.<\/p>\n<pre>avconv -i facebookvideo.mp4 -r 30 -f image2 ~\/Downloads\/Video-Images\/ImageDump\/%04d.png<\/pre>\n<p>This saves each of the frames from the video into individual png image files.\u00a0 Now we have images to provide our model rendering program.\u00a0 The program I used is Agisoft Photoscan.\u00a0 I&#8217;ve used VisualSFM with a host of other plug-ins in the past, but this method is confined to the Windows platform.\u00a0 With Photoscan, I can run all my processes on a Linux system.<\/p>\n<p>Not every frame of the video contains the object I want to render, I narrow my selection of images to those that have most of the objects features.\u00a0 This also reduces the amount of data that Photoscan will need to crunch through.\u00a0 In all, I selected 15 images that are 400 x 400 pixels in size.<\/p>\n<p>Next, from the Workflow menu, I choose Align Photos.\u00a0 I selected the Highest Accuracy with a Pair preselection of Generic.\u00a0 In the Advanced options, I left them as default.\u00a0 If I had wanted to apply masking of the images, I would have set the option Constrain features by mask.\u00a0 Masking is helpful when the images contain content you do not want included in the render, such as a tree, bush, car, dog, etc.\u00a0 This process ran relatively quick.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/10\/0272.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2565\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/10\/0272.png\" alt=\"0272\" width=\"400\" height=\"400\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/10\/0272.png 400w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/10\/0272-150x150.png 150w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/10\/0272-300x300.png 300w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/10\/0272-270x270.png 270w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><\/p>\n<p>Now I ran the Build Dense Cloud from the Workflow menu.\u00a0 I set the quality to Ultra High and accepted the remaining default settings.\u00a0 This took a couple of minutes to grind through the bits.<\/p>\n<p>Then I selected Build Mesh from the Workflow menu.\u00a0 Here I set the Source data from the Dense cloud and changed the Face count to the High value of 180,000.\u00a0 When this completed, my render look more full and it was easier to work with it.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/10\/Screenshot-from-Images-3D-Model.ogv.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2566\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/10\/Screenshot-from-Images-3D-Model.ogv-1024x572.png\" alt=\"screenshot-from-images-3d-model-ogv\" width=\"640\" height=\"358\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/10\/Screenshot-from-Images-3D-Model.ogv-1024x572.png 1024w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/10\/Screenshot-from-Images-3D-Model.ogv-300x168.png 300w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/10\/Screenshot-from-Images-3D-Model.ogv-768x429.png 768w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/10\/Screenshot-from-Images-3D-Model.ogv-484x270.png 484w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/10\/Screenshot-from-Images-3D-Model.ogv.png 1920w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>You can see that the render took well from the video source.\u00a0 The key to this success was the video had little lens distortion.\u00a0 I&#8217;ve documented in previous posts how difficult it can be when source images are warped.\u00a0 The rendering can become distorted by the lens effects.<\/p>\n<p>I hope you have enjoyed this, happy rendering.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First, source your video from facebook.\u00a0 I used a video shot from a motorbike of a structure on side of the road.\u00a0 It was from a post of a road trip in Indonesia by a fellow with my same name.\u00a0 The scene reminded me of my travels in the Southwest Pacific when I was younger.\u00a0 It looked like good material as a source for model rendering. For more information on the following steps, see this link for the details.\u00a0 I&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.cloudacm.com\/?p=2562\"> 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,10,3],"tags":[],"class_list":["post-2562","post","type-post","status-publish","format-standard","hentry","category-computer-vision","category-data-mining","category-rd"],"_links":{"self":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/2562","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=2562"}],"version-history":[{"count":3,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/2562\/revisions"}],"predecessor-version":[{"id":2564,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/2562\/revisions\/2564"}],"wp:attachment":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}