Build your 3D models with ease

(Perform 3D reconstruction with no image processing skills)

Akhil James
5 min readMay 29, 2020
Source: AliceVision

3D reconstruction has a wide range of use cases ranging from gaming to defense applications. The number of softwares supporting 3D reconstruction are on the rise and the entire process of 3D reconstruction has evolved from complex coding to mere button clicks. Image processing is one topic which is frequently associated with 3D modeling and it plays a significant role in generating 3D models from 2D images. Understanding image processing in detail requires lot of effort, patience and practice. As a result, not everyone is successful in their pursuit of building 3D models where sophisticated image processing algorithms are used.

This article explains the process of building a 3D model from 2D images without any prior knowledge in image processing. All we need is basic python skills to guide the entire process of image processing and 3D model generation which is done by AliceVision Meshroom (an opensource software). You can find the link to the source code of Meshroom below.

Workspace

Image processing can be handled by our standard PCs but they might require more time compared to a GPU which could speed up the entire process. As most of us use our smartphone cameras to capture images, I would recommend having the following tools to perform all operations.
1. Smartphone with a decent camera and Google Drive installed. The images you capture can be moved to an ‘input’ folder inside the Google Drive.
2. A Google Colab account. I picked the Google Colab account because it provides free GPU for up to 12 hours to perform all your computations. We can access the ‘input’ images in our Google Drive directly from Google Colab and the 3D model generated at the end can be moved directly from Google Colab back to the ‘output’ folder in Google Drive.
3. MeshLab is a free software that you could use to open the final 3D model in your PC. If you prefer to open the final 3D model in your smartphone, I would recommend to use Emb3D. A lot more free softwares are available for PC as well as smartphones.

In this article, I use images of a miniature model of Colosseum which I bought on my last visit to Italy a couple of years ago.

Input: 2D Images

Workflow

The complete workflow can be split into the following steps.
1. Capture images of your target object from multiple angles. Try to cover all the edges of the object so that a combination of all your images covers the 360° view of the target object. Make sure that some areas of your images overlap with areas of other images. Ensure that your images are of good quality and not blurred. Move the captured images into the ‘input’ folder in Google Drive.

2. Open Google Colab and start a new notebook. In the Google Colab ‘menu bar’, go to ‘Runtime’ and select ’Change runtime type’. Select Runtime type as python3 and Hardware accelerator as GPU. Save the settings.

3. Copy the code (steps explained as comments within the code) below in to your notebook in Google Colab and run it. Follow the steps requested in case you are asked for an authentication by Google. Meshroom will perform 3D reconstruction and the output files will be moved to the ‘output’ folder in Google Drive.

4. Download the output files and load the ‘.obj’ file using MeshLab in your PC or using Emb3D in your smart phone.

Code

Most of the code is basic operations to create folders and move files from one folder to another. Google Colab will take care of setting up the Meshroom environment in your workspace and the 3D model will be generated by Meshroom. As promised, image processing skills or coding complex image processing algorithms are not required to write the code.

Code in python

Here is the final 3D model.

Now it’s your turn to try this method and create your 3D model.
You can find the code and further details in my GitHub repository.

I would like to thank you for sparing your time to read this article. Your feedback is highly welcome.

Thank You

--

--