Metashape Workflow for multiple textures

(NB: This post is an in-depth look at the process I have developed for building “textures” using different photo sets and might be a little too in-depth for the casual reader).

Background

In most of my photogrammetry models, I’m not trying to make them “artistic” and I use the JPG files straight of the camera to save time and effort. I also shoot photos in “RAW” which has no white balance, etc. It is literally just a pixel-for-pixel file for what the camera sensor recorded. Cameras (and indeed Lightroom) automatically “interpret” those RAW images and produce JPG with various tweaks and changes.

Most serious underwater photographers will shoot in RAW and use software (such as Lightroom) to post-process those files and produce JPG (or TIFF or PNG) for display on websites, magazines, etc. Given the dynamics of underwater photography, in order to get “true” colors and improve contrast, etc. multiple “tweaks” are made before the JPG is produced.

This works well when you are shooting photos of individual subjects. But, what about when you are shooting 1000s of photos for a photogrammetry model?

This post will detail the method I currently use to make adjustments to photos and build the “texture” or “skin” of a model from those sets of photos.

Camera JPG

Other people do this differently than me, but as I said, I shoot in both JPG and RAW when I’m shooting photogrammetry projects. I detailed how I setup the two SD cards in my Sony a7rIV in an earlier post.

The first model I build is usually using the JPG files “straight out of the camera.” This allows me to save time and not do any real post-processing and to get a “baseline” model. I generally use the “Medium” level Metashape settings to build this model.

My directory structure for projects usually looks like this:

  • Project Name
    • RawJPG (these are photos right out of the camera)
    • RAW (these are RAW photos from the camera)
    • ProcessedJPG (these are JPG files created from the RAW with adjustments made)
    • Model-Name-version

Here is a sample directory structure:

Below is an example of a model with JPG photos straight from the camera. The photos for this model were under-exposed by about one-stop (we’ll fix that) and there is some red color missing due to the depth. You can still see colors even though the wreck is 200 feet deep because I shot the photos with artificial light. Otherwise, the model would have very few colors at all.

Starting Point with “out of camera” JPG

Processed RAW

There are two primary steps to the process I have developed for “re-texturing” a model.

The first is to use software to post-process the RAW files and create corresponding JPG (Metashape requires JPG). The other is create a new “texture” in Metashape (without destroying the old one).

Step 1 – Post Process

There are quite a few software programs to process RAW photos. I use Lightroom so I will use that in my example. There are a couple of very important things to keep in mind. The first is that if you have already done an alignment and/or built a model with the “out of camera JPG” you need to ensure that the photos you export from Lightroom have the same pixel dimensions and density.

One way to check the original pixel density, is to use the Finder Preview Pane. Below is an example:

In this case, you can see that the photos are 6240 x 4160 pixels with a resolution of 350 pixels per inch. These settings are generally controlled by the “quality” setting for JPG in your camera.

I won’t go into the details of making corrections to the RAW photos in Lightroom but it generally involves adjusting White Balance, in this case exposure, contrast, etc. If you don’t want to individually adjust each photo, there is the ability to copy Settings from one photo and apply to others. Once you have all of your photos corrected, you need to export them to JPG using the file export command.

There are four key settings. As mentioned, two of them are image size and resolution. The third is the “Quality.” You generally will want to have about the same quality (file size) as the original. I will start at about 85% quality, perform a single file export and check the resulting size with the “out of camera” JPG. I will then make adjustments as needed. The other setting is that you will want to use the same filenames.

Below is a portion of the of the File Export dialog box for this project:

You will need to put the Processed JPG into a different folder.

Step 2 – New Texture

This is the really important part. Our goal is NOT to build an entirely new model. Instead, the goal is to JUST build a new texture and to be able to have both (or more) available. In order to do this, we need to (1) duplicate the existing model so we don’t over-write it and (2) change the path of the photos in Metashape to point to the Processed JPG directory and (3) create the new texture.

Duplicate the Model

Before we do anything, we don’t want to “lose” the texture we have on the exiting model so we will duplicate it.

Right click on the model, and select Duplicate:

The result should be a second model. I then like to remove the existing texture and UV mapping FROM THE DUPLICATE MODEL. This can be done by right clicking on the model and selecting Remove. You might want to rename the new model just to help you differentiate.

Changing the Path – Below are screenshots of how you change the path for your photos. There are a couple ways to do this, but here is one way. Right click on one of the photos and select “Change Path” and then select the one photo in the NEW path and then select “Apply To All Images.” Note that I have selected the folder “Processed JPG” that has the new photos.

Before you go through work of building a new texture, make sure you spot check the path of a few files to ensure it points to the directory with the post-processed images. The most sure-fire way to do this is to select a few of the images and look at the preview in Metashape.

Image has the correct color and exposure correction

I also like to take the additional step to make sure all of the images were copied over and picked up so I run a Check Path command on All Images.

Results

Below is the initial result of the “re-texture” project. In this case, I overdid the exposure.

However, Metashape has the ability to change the exposure of the model and also the contrast. This is under Tools -> Set Brightness.

I lowered the brightness a bit and increased contrast a little and came up with the model below:

“Final” model

Additional Examples

I’ve been using this process for a while now and have provided a few additional examples below.

Torrey Pines P-38

Note the “greenish” color on the Camera JPG version on the left compared to the version on the right and how the “pink” color “pops” more.

Point Loma Bearcat

This one is very dramatic and illustrates the benefits of spending time on post-processing for models that you really want to “look” good and not just be “functional.”

Conclusion

I hope that this tutorial helps other people working on underwater photogrammetry. The process has worked for me for a while now and you can really see the benefits of post-processing RAW photos to create JPG for the texture.

One additional note is that Metashape does have some functionality for color correction (Tools – Calibrate Color) but I have not had a chance to explore it yet. It is on the “to-do” list for the future.

One thought on “Metashape Workflow for multiple textures

Leave a Reply