Georeferencing ImageJ output files with GDAL

I’ve been using ImageJ (aka FIJI) to create an NDVI floating point image from some aerial imagery of a heathland in Nidderdale. In order to import the NDVI output image into a GIS package or image processing software like eCognition the NDVI TIFF needs to be georeferenced.

The original aerial imagery from which the NDVI image was created has already been georeferenced so we can grab the coordinates of it’s corners and copy them over to the new NDVI GeoTIFF. The steps below go through this process.

  1. First install gdal. If you are using homebrew on a mac, the install process is as simple as
    brew install gdal
  2. Get the CRS and coordinate information from the already georeferenced GeoTIFF with the gdalinfo command
    gdalinfo sourceimage

    GDAL info
    The values we want from here are the GEOGCS (WGS84) image size (7428, 7932) upper left and lower right coordinates.

  3. Now we can take those values and create a GeoTIFF from the NDVI TIFF image with the following command
    gdal_translate -of GTiff -a_srs WGS84 -a_ullr -1.6811175 54.0748652 -1.6754438 54.0713020 GeoTiff\ ndvi-input-image.tif ndvi-georeferenced-geotiff.tif

    You will see a status bar as below as the image is tagged by GDAL.

    gdal_translate GEoTiff Tag

  4. Now we can import the NDVI GeoTIFF image into whatever GIS or image processing software we want. Below you can see the georeferenced NDVI GeoTIFF perfectly overlaid on the NGB aerial image that the georeferencing information was taken from. The GIS software in use here is QGIS.
    GeoTIFF NDVI image in QGIS
  5. Now we can go ahead and use the NDVI image to aid in vegetation classification and we can export classified objects as georeferenced *.shp files and use them in our GIS software

    Heathland classification eCognition shape file export

    eCognition shape files exported to QGIS. Credit to Letters from Sal for the how-to.

Help other people find this

2 Responses to “Georeferencing ImageJ output files with GDAL”

  1. Alex says:

    Hi,
    how do you create NDVI map without loosing your georeferences. I try a lot of software and no one can import geotiff, do the NDVI work and export geotiff!

    Thnaks for any help

    • Mark says:

      Hi Alex, I used ImageJ to create the NDVI image and then re-geotagged the image using GDAL as described above. I believe that you can create NDVI images using a GIS package and this should retain your GeoTIFF data though I’ve not tried this myself.

Leave a Reply

Your e-mail address will not be published. Required fields are marked *