How to retouch digital photos for photogrammetry
Why I shoot RAW, and the Lightroom adjustments I make before structure from motion: white balance, highlights and shadows, clarity, saturation and detail.

In this article I’ll talk about digitally retouching photos for photogrammetry, tell you why I shoot in RAW format and how I “treat” the images to optimise software processing and create a good 3D model.
Photogrammetry was born at the end of the 1800s and is a technique for determining the shape, size and position of an object from its photos.
The object (the ground, a building or an item) must appear in at least two images, taken from two different viewpoints.
This holds both for classic photogrammetry, done with metric cameras and frames printed on paper, and for modern (non-conventional) photogrammetry, done with digital cameras and files.
And it holds both for terrestrial photogrammetry and for aerial photogrammetry, which today is done largely with drones.
Even though you can’t do photogrammetry with photos alone (you need measurements too!), everything starts from the images, and that’s where you take the information to process in order to reconstruct a digital version of what you’re surveying.
Taking quality images is the first step to a good photogrammetric survey.
Blurred, overexposed or underexposed photos complicate the work of the software that has to process them.
And by processing I mean all the Structure from Motion procedures that lead to a 3D model of what you photographed, or surveyed.
If you want to go deeper into this, I’ll refer you to the series Paolo Rossi (of the Geomatics Laboratory of the Engineering Faculty of the University of Modena and Reggio Emilia) wrote on this blog about using Agisoft PhotoScan for photogrammetry. You’ll find the first part here.
But there’s another important aspect, sometimes underestimated (or even forgotten), concerning the photos of a survey.
If you take it into account and work on it, you can improve the processing of the 3D model.
It isn’t as fundamental as correct focus or exposure, but it contributes to a good result.
I’m talking about digitally retouching photos for photogrammetry, after shooting and before processing.
I shoot RAW
Before going into the details of editing, post-production or digital photo retouching, you should know that (almost) everything I’ll tell you applies to digital image files in RAW format.
You know there are different types of digital image file: raw, jpg, tif, png, psd, gif…
The best known in photography are raw, jpg and tif.
The most used in photogrammetry are raw and jpg.
Depending on your camera’s brand, instead of a .raw extension you might find something like .dng, .nef, .crw, .orf…
Don’t worry, they’re proprietary formats, all falling into the category of raw files.
All digital cameras shoot jpg, and many can also shoot raw.
A raw file is an image that hasn’t been processed by the camera’s processor and can still be changed after the shot.
If you shoot jpg, the camera makes choices for you, based on its brain, and gives you a file that has already been somewhat modified.
You can change it, but not with the ease and range of options you’d have for the same scene recorded in raw.
RAW and JPG
Think of the relationship between raw and jpg as the one between negative and print in film photography.
When you took a roll of film to be developed, the photographer gave you the negatives along with the prints, the strips holding the exposures.
From the negatives you could make copies of the prints, enlargements or stylistic changes (though only people who developed their own photos know this), all without losing quality.
When I shot film, I guarded my negatives like the Holy Grail!
Without the negative, all you could do was scan and reprint, which degraded the image (through the various steps) and made it impossible to get a bigger photo without losing resolution.
In digital photography, swap film for sensor.
The captured data are stored in bits.
The camera makes a first translation of the scene into bits, mixing together, as in a big pot, the colour information (RGB – red, green, blue) and brightness (luminance).
If you save as jpg (the same goes for tif), there’s a second step where the data are fixed, discarding some and choosing others, to get the right image according to the camera’s brain, based on its reading of sharpness, white balance, saturation, …
The jpg file is then immediately compressed too (with a so-called lossy compression algorithm) to keep its size in megabytes fairly small, at the expense of losing information.
When you choose to store raw files instead, you stop right after the analogue-to-digital conversion.
The camera stores all the data the sensor captured and saves the bits in a file much heavier than the jpg.
At this point, though, you don’t yet have an image, even though you see a preview on the display, and before you can see it properly it has to be developed in the digital darkroom.
The darkroom was where analogue negatives were developed, which were ruined if exposed to light; the digital darkroom is the software where you develop digital negatives, and you can work with the lights on!
With these tools you can change lots of parameters of a raw file without ever really modifying the image.
At the end you export the file as jpg or tif, for printing or further processing (as in Structure from Motion), but the original raw file is always available for other processing, colour toning, cropping, enlargements, stylistic changes and so on…
One last technical detail: the bit depth of a raw file ranges from 12 to 14, while for jpg it’s only 8.
This is an important figure (though perhaps more for the creative-technical side of photography) that defines how many bits are used to create a colour and how many shades it will have.
More bits = more shades of colour.
So if you want to handle the camera’s full dynamic range, it’s better to use this format.
Disadvantages of a RAW file
But shooting raw doesn’t only have advantages!
There are some drawbacks too, although in my view the balance always tips in favour of raw over jpg.
A raw file is much heavier, in megabytes, than the equivalent jpg. If you shoot raw, you’ll reduce the number of photos a memory card can hold, as well as the writing speed at the time of shooting.
In practice this means you’ll need spare memory cards, and if you’re doing an aerial survey with a drone you’ll have to lengthen the interval between shots to give the card time to write all the images.
Being raw, raw files need post-production with photo editing software.
There’s one more link in the chain of the photogrammetric process and of handling field data: the software.
I use Adobe’s Lightroom.
It isn’t the only or the best software for “developing raw files”; there are others (Capture One, and free ones such as darktable and RawTherapee), but I’ve used it for many years, its interface is intuitive and simple, and I’m very comfortable with it.
It’s available by subscription from Adobe, together with the better-known Photoshop.
RAW doesn’t work magic
I’ll close this part on raw files with a brief warning: “shooting raw doesn’t fix a bad photo”.
Although raw has all the advantages I’ve described and gives you a lot of freedom in post-processing, you can’t hope to pull information out of an image where there isn’t any.
If you take a badly overexposed photo, there’ll be completely white pixels from which you can’t recover any information about what was photographed.
The same goes for black pixels in a shadow area of a badly underexposed photo.
And working on the raw won’t make a blurred image sharp.
So pay attention to the shooting parameters of a photo (shutter speed, aperture, ISO), because raw helps but it isn’t Merlin the wizard!
🙂
Treating photos for photogrammetry
After talking about the raw file, I’ll show you the steps I follow to retouch photos for photogrammetry, before processing them in Structure from Motion software.
I chose an image taken by my drone’s camera, a DJI Phantom 4 Pro, during an aerial photogrammetric survey, with some areas in shadow, others in light and areas rich in detail.
The photo was taken about 70 m above the ground with the camera in nadir position (optical axis pointing vertically down).
The exposure parameters are: shutter speed 1/320 sec, aperture f/5.6, ISO 100.
The scene is lit by direct sunlight at 1 pm on a mid-April day.
This is the original image, with no adjustments:

Now I’ll show you all the steps, with their results, that I take to get to the finished photo, ready for export.
Exposure, white balance, highlights and shadows
The first group of actions concerns the image’s luminance values and correcting colour casts.
White balance
A camera’s brain doesn’t work as well as ours, which adapts to changes in light and scene very quickly.
A camera doesn’t know what kind of light falls on a scene (midday sun, sun filtered by clouds, a lamp) and can render the colours of a photo wrongly (each light source has its own colour temperature).
I won’t go into white balance in depth, otherwise this article risks becoming really long, but it’s enough to know that with the white balance picker you tell the software which element of the image has a neutral tone (white or grey), and based on that it adjusts all the tones of everything else.
In this photo I told Lightroom to use as a reference the grey of the asphalt road you see at the top right of the image.
The result is an image with warmer tones:

Exposure
If your photo is underexposed or overexposed, you can fix it now.
This image didn’t need it, but if needed you can work using the image histogram, which shows how brightness is distributed over all the pixels of the photo (recorded by all the pixels of the sensor).
Generally (though not always), for an evenly lit scene the histogram curve should have a hump, a build-up of information, in the middle, while for overexposed or underexposed images the curve shifts to the right or left of the graph respectively.
All raw editing programs show you the histogram, and you can work on exposure to balance it.
Contrast
Increasing contrast helps give the image body.
I always increase contrast a little, but without overdoing it (here +15).
This is the image with added contrast:

Highlights, shadows, whites and blacks
This is, in my view, the most important adjustment for optimising a photo for photogrammetric processing!
On a sunny day you’re very likely to end up with a photo with dark shadows and quite bright lit areas.
This happens because the camera has a limited dynamic range, much smaller than the human eye’s, and can’t correctly render, in terms of exposure, everything in a scene.
Lowering the highlights reduces brightness in the light areas (-100).

Raising the shadows brings out information in the dark areas (+100).

Then working on whites and blacks lets you refine this search for information at the extremes of the photo’s dynamic range.
I lower the whites a little (-20).

And raise the blacks (+20).

Clarity and dehaze
Clarity is a measure of local contrast in the image.
Increasing clarity means increasing contrast by working on small portions of the image (for which light and shadow parameters are calculated), without considering the overall lighting of the scene.
I usually increase clarity a little (+20), but never much, because overdoing it risks an artificial-looking photo.

If you took the photo in particular conditions or notice a slight “hazy veil” over it, you can also use dehaze, which works on mid-scale contrast.

Saturation
If you think your image’s colours are too vivid, or conversely too dull, you can adjust the vibrance and saturation parameters as you like.
Vibrance increases or decreases the saturation of colours that are less saturated, while saturation acts on all colours equally.
I usually raise vibrance slightly (+10) and lower saturation, again slightly (-10).

Detail
The detail setting is the other adjustment I consider important when retouching photos for photogrammetry.
To show you how a raw editor works on an image’s detail, I’ll show you a crop of the photo at 100% of its native size.
Only that way can you really judge detail.
This is the photo before adjusting detail:

And this is the same area after increasing detail:

By working on detail you can recover lots of valuable information in the images, which the photogrammetry software uses to search for common points during image alignment (creating the sparse cloud) and when creating the dense cloud.
Before and after
The digital retouching process is finished.
Now you can export the image as jpg and move on to processing in the SfM software.
Here are two before-and-after comparisons.
In this figure you can see how information and details can be recovered in shadow areas that would otherwise be harder to make out:

In this image you can see how exposure in the light areas (circled in red) was reduced and overall detail increased (area circled in yellow):

At these links you can download the high-resolution files of the image, before and after:
Original image
Edited image
All this helps the photogrammetry software, giving it a bit more information in each image for the algorithms that solve the collinearity equations and the structure from motion process.
Apply the adjustments to all the images
If you’re alarmed at the thought of doing all these steps for every image of a photogrammetric survey (often easily over a hundred!), relax: most software that works on raw files lets you copy the development settings of one image and apply them to all the images of that survey.
Or at least to all the images with similar lighting.
The software does it in a few seconds, even if you’ve taken thousands of photos.
If, however, the light changed during the survey, perhaps because the sun was often behind clouds, I’d suggest grouping the images by lighting conditions and developing the full-sun photos slightly differently from the overcast ones, always with the aim of recovering as much information as possible from each image to optimise processing.
Structure from motion processing and RAW files
Some structure from motion photogrammetry software can now take raw files as input.
Agisoft PhotoScan, which I use, does.
Personally I’m not very comfortable working with these files, because they slow the program down a bit, with longer loading times, especially when entering and validating the coordinates of the control points (already a time-consuming part!).
In surveys with many photos I prefer exporting jpg files from the raw images, developed as I’ve shown you.
I hope I’ve given you useful information on retouching photos for photogrammetry before processing them into a 3D model.
These steps aren’t essential, but I’ve found them useful for a 3D model that’s richer in information and quicker to create.
The adjustment values I’ve given refer to the software I use (Adobe Lightroom) and can vary from program to program and from scene to scene (a photo of a white marble quarry in full sun needs different settings from a wood on a cloudy day!).
I confess I’ve always been a photography nerd, even before sending a drone up to take photos for aerial photogrammetric surveys, so I’ve always been familiar with these technical aspects.
I photographed when film was still used and worked quite a lot in photography.
If you have doubts, questions or comments on these topics, get in touch however you prefer, from the contact page. My favourite way is a message or voice note on Telegram, @paolocorradeghini.
Thanks for your time, and see you soon!
Paolo Corradeghini