Creating 3D Models with Agisoft Metashape


Is this your first model creation? Need a reminder Check out our Agisoft Metashape Tutorial series on YouTube, demonstrating each of the steps below. The videos seem to play best when viewed in Firefox or Edge.

Preparation

Follow along with the [Agisoft Metashape Tutorial series] to familiarize yourself with the program and process.

Open 3D folder associated with the object you are modeling

Step 1: Create a new Agisoft Project

  1. Open Agisoft Metashape
  2. Click File > Save As
  3. Navigate to and double-click on the correct item’s folder (for example: CE_CA_D4_2394)
  4. Double-click on Project folder
  5. Type the file name, which should include the cabinet letter, drawer number, and item number
    • For example: CE_CA_D4_2349_3Dproject
  6. Click Save

Step 2: Add photos to the Agisoft Project

We will need to add photos in two separate chunks to make sure that they are aligned correctly.

  1. Double click Chunk 1 to select, right click > click Add Folder
  2. Navigate to the correct 3D artifact photos folder
  3. Double click on Processed-JPEG
  4. Single click on the View 1 folder in the photos folder > click Select Folder
  5. Make sure that single cameras and add all images to one chunk are selected > Click OK
  6. Under Chunk 1, right click and select Add Chunk 1.Repeat above steps to upload View 2 photos to Chunk 2
  7. Click Save

Next, we need to delete the photos that include the sticky notes or index cards since we don’t want to use these in our model creation.

  1. Double click Chunk 1 > navigate to the Photos section
  2. Single click on a photo with a sticky note or index card
  3. Click the X icon and click Yes to remove one camera
  4. Repeat these steps to delete all of the photos with sticky notes or index cards in Chunk 1
  5. Repeat all steps for Chunk 2
  6. Click Save once you’ve deleted all of the photos with sticky notes/index cards in Chunk 1 and Chunk 2

Step 3: Import a background image/mask

In most cases the background color will depend on the object being digitized. You will likely need to make a new background image/mask for each object, follow the Creating a Mask instructions.

  1. At the top of the screen, click Workflow > Batch Process
  2. Click Add
  3. Click in the first dropdown box and scroll to and select Import Masks
  4. Confirm that All chunks is selected in the second dropdown box
  5. In the Parameters box, double click each box to set:
    • Method = From background
    • Operation = Replacement
    • Tolerance = 20
  6. Double click in the filename template box and type the file name for the _mask-pixels.jpg file you created
    • For example: CE_1245_mask-pixels.jpg
      • Don’t forget to add the .jpg
  7. Double click in the Folder box > navigate to the folder where the mask image has been saved
  8. Click the folder > click Select Folder
  9. Click OK then click OK again
  10. Once the masking process is complete, click Close
  11. Then click Save

The masking process should take approximately 5 minutes.

Double click on a few images in the Photos section to review the mask application. Don’t worry if the base is still visible or if small portions of the artifacts have been masked, this will be fixed later in the 3D model creation process.

However, if too much of the artifact is masked, complete the Import masks tasks again but lower the tolerance to 10.

Step 4: Align photos

  1. Click Workflow > Batch Process
  2. Uncheck the box for previous job, if necessary
  3. Click Add
  4. Click in the first dropdown box and scroll to and select Align Photos
  5. Confirm that All chunks is selected in the second dropdown box
  6. In the Parameters box, double click each box to set:
    • Accuracy = High
    • Generic preselection = Yes
    • Reference preselection = Disabled
    • Reset current alignment = No
    • Key point limit = 80,000
    • Key point limit per Mpx = 1,000
    • Tie point limit = 8,000
    • Apply masks to = Key points
    • Exclude stationary tie points = Yes
    • Guided image matching = No
    • Adaptive camera model fitting = Yes
  7. Click OK then click OK again
  8. Once the photos have aligned, click Close
  9. Then click Save

Photo alignment should take between 2 to 15 minutes, depending on the number of images.

At the top of the screen, click Model to navigate to the initial model that Agisoft created during image alignment.

Step 5: Refine the bounding box

The bounding box is the light grey 3D cube that encapsulates the object. The object needs to completely contained in this cube. To check this:

  1. Double click Chunk 1 > double click on the model to center it within the screen
  2. Use the navigation ball to spin and flip the model to make sure it is contained within the bounding box
  3. If a portion of the model is cut off, click the Region icon > select Resize region
  4. Drag to resize the region so that the entire model is inside the bounding box
  5. After you’ve refined the bounding box for Chunk 1, click Save
  6. Repeat all steps for Chunk 2 > click Save

Step 6: Build dense cloud

  1. Click Workflow > Batch Process
  2. Uncheck the box for previous job, if necessary
  3. Click Add
  4. Click in the first dropdown box and scroll to and select Build Dense Cloud
  5. Confirm that All chunks is selected in the second dropdown box
  6. In the Parameters box, set:
    • Quality = Medium
    • Depth filtering = Mild
    • Reuse depth maps = Yes
    • Calculate point colors = Yes
    • Calculate point confidence = Yes
  7. Click OK then click OK again
  8. Once dense cloud generation is complete, click Close
  9. Then click Save

Dense cloud generation should take between 5 to 15 minutes for Medium quality and up to 1.5 hours for High quality.

Click the Dense Cloud icon to see the results.

Step 7: Build the mesh

  1. Click Workflow > Batch Process
  2. Uncheck the box for previous job, if necessary
  3. Click Add
  4. Click in the first dropdown box and scroll to and select Build Mesh
  5. Confirm that All chunks is selected in the second dropdown box
  6. In the Parameters box, set:
    • Texture type = Dense cloud
    • Surface type = Arbitrary (3D)
    • Depth maps quality = High
    • Face count = High
    • Custom face count value = Generated automatically, so you don’t need to change that
    • Depth filtering = Mild
    • Interpolation = Enabled
    • Point classes = All
    • Calculate vertex colors = Yes
    • Reuse depth maps = Yes
    • Use strict volumetric masks = No
  7. Click OK then click OK again
  8. Once mesh generation is complete, click Close
  9. Then click Save

Mesh generation should take approximately 5 minutes.

Click the Model Shaded icon to see the results.

Step 8: Edit the mesh

  1. Double click Chunk 1 > double click on the model to center it within the screen
  2. Remove clay base and : click the navigation icon and use the navigation ball to spin and flip the model so that the base is relatively flat to start
  3. Click the Zoom in and Zoom out icons to make the model bigger or smaller within the screen
  4. Click the Selection icon > choose Rectangle selection
  5. Draw a rectangle around the base area you want to delete
    • Try to be as careful as possible when deleting the clay/eraser base from the model as you don’t want to remove too much of the object itself
      • But don’t worry about perfection as Agisoft Metashape will use the images in the other chunk to reconstruct the base areas that have been removed
    • If you do end up highlighting an area you don’t want to delete, simply click in a blank area of the bounding box, then redraw your rectangle
    • Ctrl+Z can also be used to undo a previous mistake
  6. Once you are happy with the shape and area you’ve highlighted, press Delete on your keyboard
  7. Click the navigation icon and use the navigation ball to spin and flip the model to the other side
  8. If you still need to delete some of the base, click the Selection icon > choose either Rectangle selection or Freeform selection
  9. Draw a shape around the base area you want to delete > press Delete on your keyboard
    • You might need to use the navigation icon and navigation ball to tilt the model so you can delete any remaining portion of the base
  10. Once we’ve deleted the base on both sides of the model, we need to delete the stray points
  11. Click the Zoom out icon to and zoom out until you see the entire bounding box
  12. Click the Selection icon > choose Freeform selection
  13. Draw a shape around the stray points you want to delete
  14. Once you are happy with the shape and area you’ve highlighted, press Delete on your keyboard
  15. Continue to delete any stray points that appear in the bounding box
    • You may need to use the Zoom in and Zoom out icons as well as click the navigation icon and use the navigation ball to spin and flip the model to find and remove all stray points
  16. Once you’ve edited the mesh for Chunk 1 > click Save
  17. Repeat all steps for Chunk 2 > click Save

Step 9: Apply masks from model

  1. Double click Chunk 1
  2. Click File > Import > Import Masks
  3. In the Parameters section, set:
    • Method = From model
    • Operation = Replacement
    • All cameras = Box checked/selected
  4. Click OK
  5. Click View > Photos
  6. Double click on a photo to the see the result of the mask
    • We can now see that the entire background, including the base, has been masked
  7. After the new mask is imported for Chunk 1, click Save > click the X icon next to the image to close it
  8. Repeat all steps for Chunk 2 > click Save

Applying masks from the model should take approximately 1 minute per chunk.

Step 10: Align chunks

  1. Click Workflow > Align Chunks
  2. Confirm that both chunks are checked
  3. In the Parameters section, set:
    • Method = Point based
    • Accuracy = High
    • Key point limit = 80,000
    • Apply masks to = Key points
    • Generic preselection = Box checked/selected
  4. Click OK
    • The status box will disappear once complete
  5. After chunk alignment is complete, click Save A T sympbol will appear next to each Chunk in the Workspace if successful. Chunk alignment should take approximately 2 minutes.

Step 11: Merge chunks

  1. Click Workflow > Merge Chunks
  2. Check the boxes for Chunk 1 and Chunk 2
  3. Check the boxes for:
    • Merge dense clouds
    • Merge models
    • Merge depth maps
  4. Click OK
    • The status box will disappear once complete
  5. Once this process is complete, we will see a new chunk named Merged Chunk
  6. Double click on the Merged Chunk to see the results
    • If our model creation process was successful Agisoft will have taken the models from both Chunk 1 and Chunk 2 and combined them to create a new and model
    • Sometimes when merging chunks, the new chunk will disappear from the screen. If this happens, use the Zoom out icon to zoom out until you see it, double click on the model to center it within your screen, then use the Zoom In icon to zoom back in
  7. Once merging chunks is complete, click Save

Merging chunks should take approximately 2 minutes.

Step 11.5: Decimate Mesh

Prior to building the texture, the Mesh needs to be downsized.

Step 12: Build texture

  1. Double click on the Merged Chunk
  2. Click Workflow > Build Texture
  3. In the Parameters section, set:
    • Texture type = Diffuse map
    • Source data = Images
    • Mapping mode = Generic
    • Blending mode = Mosaic
    • Texture size/count = Generated automatically, so you don’t need to change that
    • Advanced section:
      • Enable hole filling = Box checked/selected
      • Enable ghosting filter = Box checked/selected
  4. Click OK
    • The status box will disappear once complete
  5. Once texture generation is complete, click Save
  6. Click Save after building texture

Click the Model Shaded icon and select Model Textured to see the results.

Step 13: Export 3D model

We will export the 3D model in three different file formats.

Wavefront OBJ model (.obj)

  1. Click File > Export > Export Model
  2. Navigate to and double-click on the correct item’s folder in your personal OneDrive (for example: CE_CabinetA_D4_2394)
  3. Double-click on the Models folder
  4. Type the file name and add -model to the end of the file name
    • For example: CE_CabinetA_D4_2349_3Dproject-model
  5. Set the Save as type to Wavefront OBJ
  6. Click Save
  7. In the Export Model dialog box, set:
    • Export texture = JPEG
  8. Click OK

Wavefront OBJ models generate two additional files that are associated with the model: an .mtl file and a .jpg file. All three files (.obj, .mtl, and .jpg) must be placed in the same folder.

STL model (.stl)

  1. Click File > Export > Export Model
  2. Navigate to and double-click on the correct item’s folder in your personal OneDrive (for example: CE_CabinetA_D4_2394)
  3. Double-click on the Models folder
  4. Type the file name and add -model to the end of the file name
    • For example: CE_CabinetA_D4_2349_3Dproject-model
  5. Set the Save as type to STL models
  6. Click Save
  7. Click OK, if prompted

X3D model (.x3d)

  1. Click File > Export > Export Model
  2. Navigate to and double-click on the correct item’s folder in your personal OneDrive (for example: CE_CabinetA_D4_2394)
  3. Double-click on the Models folder
  4. Type the file name and add -model to the end of the file name
    • For example: CE_CabinetA_D4_2349_3Dproject-model
  5. Set the Save as type to X3D models
  6. Click Save
  7. Click OK, if prompted

Step 15: View 3D model

  1. Open the 3D viewer app
  2. Click File > Open
  3. Navigate to the folder where the model was saved
  4. Select the model you want to view
  5. Click Open

The STL file will not include the artifact’s original colors, but is often used for printing a 3D model. In comparison, the OBJ file will include the artifact’s original colors, and is often used for display purposes on the web.

Step 16: Edit model in MeshMixer

  1. Open MeshMixer program
  2. Drag and drop .stl file into MeshMixer
  3. On left side, click Analysis > Inspector > CLick Auto Repair All > choose Done
  4. Navigate to Edit > choose Transform
  5. Move the red, blue and green rounded bars until the object orrientation is correct. We want the green arrow to be vertical. To ensure this, on the faint circle around the object a “L” and “W” are present and the “L” is usually green, choose the “W”.
  6. To resize the object to reflect acutal size. Double click in the Size Y and enter the length of the object in mm.
  7. Click Accept
  8. Export the .stl
  9. File > Export > choose .stl
  10. You will simply replace the previously created .stl with the new MeshMixer version.

Create a mask

You should be able to use the same background image/mask across objects, so long as the Foldio background color doesn’t change. If you need to make a new background image/mask, follow the instructions below.

The following documentation on creating a mask is adapted from Samantha Porter’s “Supplemental Instructions on Background Masking” (file name: Supplemental_Instructions_1_Background_Masking.pdf).

Create a background image in Microsoft PowerPoint

  1. Open Microsoft PowerPoint and create a blank presentation
    • Delete the empty text boxes
  2. Navigate to the Insert tab, click Pictures > This Device
  3. Navigate to the set of images you want to create a mask for, select one of the images, and click Insert
  4. Navigate to the Picture Format tab and make note of the image size, for example 7.5” by 11.25”
  5. Navigate to the Insert tab, click Shapes > Rectangle
  6. Drag to create a small rectangle and click on it
  7. In the Shape Format tab, click Shape Outline > No Outline
  8. In the Shape Format tab, click Shape Fill > Eyedropper
  9. Click the eyedropper within your image’s original background to select that color
  10. Click the rectangular image, navigate to the Shape Format tab, and change the shape size so that it matches the original image
  11. Right click the shape and select Save as Picture
  12. Navigate to (file location)
  13. Change the Save as type to JPEG File
  14. Rename the file as itemnumber_mask and click Save
  15. Close Microsoft PowerPoint - there is not need to save the presentation

Determine image pixel size

  1. Navigate to the images you scanned, right click on of them, and select Properties
  2. Navigate to the Details tab and the Image section
  3. Make note of the Dimensions, for example 6240 X 4160

Edit background image pixels in Microsoft Paint

  1. Open Microsoft Paint
  2. Click File > Open
  3. Navigate to the mask you created and click Open
    • Change the Zoom Level to 25%
  4. Navigate to the Home tab and select Resize
  5. In the Resize by section, select Pixels
  6. Refer back to the dimensions you noted and enter the pixel size
  7. Make sure the Maintain Aspect Ratio box is checked
  8. Click OK
  9. Click File > Save As > JPEG picture
  10. Navigate to the background image location, rename the file as itemnumber_mask-pixels, and click Save
  11. Close Microsoft Paint