Tips, tools and processes
Note - this is a document generated primarily for people within the AAD sea ice group. However, digital image analysers anywhere may find some useful things here.
Here is a collection of tools, tips and suggested workflows for analysing digital aerial photographs.
Useful [free] tools...
Imagemagick is essential. You can use it to apply operations to vast numbers of images very efficiently, without pesky GUIs to use up valuable computational resources.
Exiftool is also very useful. You can use it to extract GPS data from image headers - and also put GPS data in. It is installed on the SIPEX server, and is fairly straightforward to install on a MacOS 10.?? machine too. I haven't tried the windows executable.
...and don't forget your unix shell! You can automate many tasks using simple shell scripts, so take the time to learn a bit about scripting in the shell. Also, many image batch process are very computer intensive, so learn about the 'nice' command, too.
Image pre-processing
Removing vignette effects
Vignetting is the photo geek name for those dark corners you get when using wide angle lenses. They arise because light from the corners takes longer to hit the sensor, or film - so they are underexposed. Its an issue particularly when your analysis algorithms rely on thresholding an image.
Imagemagick gives a great method gives a method for vignette correction using the following algorithm:
corrected = (original/correction) * correction[width/2, height/2]
...where 'correction' is an image taken using the same camera/lens as the original, of a flat white surface. In English, you divide the original image by the correction image, then multiply the result by the centre pixel value of the correction image. The same correction images could be used in IDL, or matlab, or your analysis weapon-of-choice.
Note - you need ImageMagick v6+ to use the '-fx' option with convert.
Quick-and-dirty correction images are available for a Nikon D1X with a 28mm or 14mm prime. Look out - they're 17 MB each! I'll find a big, brightly-lit flat white wall soon to make better ones. Correction images for the G7 and Olympii at the wide end of the focal range will come too, but their priority is lower.
A bare-bones shell script using ImageMagick for image conversion is here too.
In IDL, I found the best results when I loaded the correction image as a 3 x width x height array, then applied each band to its corresponding band in the real image. Something like:
corrected[R] = (original[R,*,*]/correction[R,*,*]) * correction[R,(width/2),(height/2)]
...used for each of the three colour bands. You can convert the three corrected bands to a grey scale image, or pile them back into an RGB image once the correction is done.
Lens distortion correction
After a long chat with Jon Osborn from the centre for spatial information science, we determined that lens distortion is almost negligible - one or two pixels at the extreme corners of images. So, we can negect it.
Reading EXIF headers
We need to read image EXIF headers so that we can extract things like image capture time, altitude and location from embedded GPS information.
Barry Giles generated a script to read the Nikon D1X TIFF headers in IDL - a work of great cunning, and quite useful.
A better apporach is our new favourite toy, exiftool.
Once you have all this information you can calculate variation in pixel size, flight tracks and all kinds of stuff. You can also make metadata files for the AADC.
Preparing images for the AADC
We're working on making our extensive aerial photography dataset available via the Australian Antarctic Data Centre. A few steps are involved in doing so, as follows:
- First, prepare DVDs of all your real images - hopefully as you capture them. Keep a copy, and make one for the AADC. Label them well!
- Generate image summary files, using the IDL programs in the /AADC/ directory
- Generate thumbnail images using this shell script, which invokes imagemagick to do the dirty work. Remember to modify the input and output directories to suit your needs
- Load the thumbnails and summary file to a place where the AADC can download them. And let the AADC know that they're there.
- Send the clearly labelled DVDs of the full images to the AADC
- Bask in the warm glow of scientific good will.