Create a 3d Model With Metashape

AgiSoft Metashape is a photogrammetry application that can be used to create 2d or 3d models from images. For some examples of models created by the Trinity community see our collection on Sketchfab. You can download and install a fully functional 30 day trial for Mac or Windows here: https://www.agisoft.com/downloads/installer/.

  • The professional version of Metashape has a few more features but this tutorial had been developed to be used with the standard version.
  • This tutorial describes using a lightbox and turntable for photography. This is the best approach for smaller objects but is not always possible especially for larger objects. For a more general overview of Metashape see this post: Introduction to Metashape
  • Currently Metashape standard is available on our Virtual Desktop. For more info see: https://edtech.domains.trincoll.edu/windows-virtual-desktop/

Taking Your Pictures

Starting with good images is critical. Take your time and get plenty of good quality photos.

  • Our turntable has a setting to make 32 stops in one revolution which gives us plenty of overlap and a regular change in orientation which helps the process.
  • You could use more or less images but you need to make sure you have plenty of overlap between images, at least 50%-80%.
  • Make sure lighting is as diffused as possible. Polarized lighting is ideal but we have not yet experimented with it.
  • We recommend using a marker palette such as these or these. While the standard version of Metashape does not allow for marker detection or scaling these will still help with alignment.
  • After one revolution on the turntable, rotate the object (by lying it on its side or turning it upside down) and take images for another revolution, then rotate again and repeat. You may need peices of foam to prop up your model so it doesn’t move. If you have 3 different orientations you can be confident you have images from all angles and will end up with 96 total images. See the image below for an example from Metashape showing the camera positions used to model a doorknob for Watkinson Library. You can see the 3 different rings of images that show the 3 different orientations used to take the images.
Camera positions for 3 different orientations

Add the images in Metashape

Add the images into Metashape. You can just drag and drop or use Add images or a folder under the Workflow menu. Each set of images should be its own chunk. If you took 3 sets of images in different orientations as explained above you will have 3 chunks listed in your workspace as shown here.

Align the Images

Align images batch process

Under the workflow menu choose Batch Process at the bottom so we can align all the images in each of our chunks in a batch process. Another benefit of using the batch process is it can automatically save the project after each step which will prevent you from losing work if the virtual machine times out. Just be sure to check that box!

  • Higher accuracy setting will take more processing time,
  • For Key point limit the recommended range of 20,000 to 100,000, start with 40,000
  • For Tie point limit the recommended range is 2,000 to 40,000, start with 10,000. Setting it to zero means unlimited. This may be useful for very large objects or if you want to refine your model as much as possible.
  • Be sure to exclude stationary tie points when using this turntable method

Region set and cutting off bottom marker palate

Resize the Region

After alignment you will see a box surrounding your model. Chose resize region to make this box as small as possible. You will probably want to rotate the region as well to match the orientation of your object. Make sure to cut off any parts of the turntable or other objects you may have used to prop up your model. These areas should be captured by one of the other views. Be sure to rotate the model repeatedly after adjusting the box to make sure parts of the model are not cut off. Do this for each chunk.

Generate and Clean Mesh

Next we will generate a low quality mesh to be used as masks for later steps. Under the workflow menu choose batch process, select Build Mesh and set the Depth maps quality and Face count to low. Once the mesh is finished inspect the mesh for each chunk. If you see any stray pieces floating around the model you should remove them. You can use the select tools to manually select and delete them but we recommend using the Gradual Selection took under the model menu. For criterion choose Connected component size and for Level enter 99. When this is run it should select everything EXCEPT your main model and you can click delete to remove them. Do this for each chunk. The easiest way to do this is to use the batch process and be sure to select the option to save after each step.

Create Masks

Now we will use the mesh we just created to generate masks for each image. Right click on any photo and choose Masks – Import Masks… Confirm the method is from Model and if you choose the entire workspace option it will generate masks for all images at once. This step is very quick.

Align Chunks

The next step is to align our chunks to create a single model. Under the workflow menu choose align chunks. Make sure all your chunks are selected, the method is Point based and accuracy is high. Finally choose to apply masks to Key points. When finished click the show aligned chunks button to see the result. It may also be helpful to toggle the cameras on and off so you can easily tell if the alignment was successful. If it was successful proceed to the next step. If it wasn’t you can try aligning different combinations of chunks. If you can’t find a combination that works you may not be able to merge the chunks and will have to settle for a partial model or start over with a new set of pictures trying to obtain better quality images.

Merge Chunks

From the workflow menu choose Merge Chunks. Select the chunks you want to merge, leave the rest of the boxes unchecked. Once the chunks are merged you should see a new item in your workspace called merged chunks. Double click that to select it. Now we need to resize the region again. This time we don’t need to cut off the base and markers but we want to region to be as small as possible while still containing the object.

Build High Quality Mesh

After merging we can build our higher quality mesh. Choose Build mesh from the workflow menu and set the desired quality. Medium quality may be fine for many models and is quite a bit faster than high quality.

Build Texture

Once you are happy with your model we will build the texture. This process uses the original images to put a detailed, high quality image on the mesh. Choose built texture from the workflow menu and accept the defaults. This process is quick.

Export the Model

Now that you have a finished model you can export it. Under the file menu choose Export – export model. the default format is an .obj format which is what we normally want. Accept the defaults and export the final model. This will create 3 files: an obj file, jog file and mtl file. These must all stay together and can not be renamed. IMPORTANT – when naming this file do not use any spaces or it may not load properly in some viewers.