Calibrating DJI Camera NDVI (Red+NIR) Images

This page explains how and why we calibrate images used for measuring the reflectance of materials such as vegetation in a crop field.

 

Why Is Calibration Necessary? 

 

Our sun emits a large spectrum of light which is reflected by objects on the Earth's surface. A camera can be used to capture this reflected light in the wavelengths that the camera's sensor is sensitive to. The sensors that we supply are based on silicon which is sensitive in the Visible and Near Infrared spectrum from about 400-1200nm. Using band-pass filters that only allow a narrow spectrum of light to reach the sensor we can capture the amount of reflectance of objects to that particular band of light.

 

 

 

For instance if the camera's filter selects two 25nm wide bands with peak wavelengths of 660nm and 850nm (see below graph) it will only capture the reflected "red" and "near infrared" light emitted by the sun around those wavelength peaks. These are the peaks in the NDVI (Red+NIR) filter we sell cemented to the bottom of the 3.97mm (recommended), 4.35mm, and 5.4mm lenses. Each pixel in the image's RGB channels is thus a percentage of the reflected light allowed to pass through the filter.

Pixels have a value that range from a minimum to a maximum based on the image bitrate. The higher the bitrate the more information that can be stored in the image. A sensor captures each image in a RAW format and then saves the RAW or converts it to a more common format (typically by compressing it). The DJI cameras capture 8bit (per channel) DNG photos, which means there are 8bits (256) pixels and a pixel value range from 0 to 255. When the camera saves a JPG it compresses (removes) the original pixels leaving a range of only 0 to 255 and noticeable compression if you zoom in. Since we are capturing a reflectance of light and not trying to make a "pretty picture" we want to always use the DNG format. If you need a JPG you can easily convert the DNG to TIFF to JPG using our MAPIR Fiji plugin (see below).

Always set the camera to RAW (DNG) mode for the best results, as calibrating the JPGs will further compress them and it may make it difficult to stitch. If you need JPGs as the final result (such as for online services like Drone Deploy) you can save the TIFFs as JPGs during calibration.

It is important to also make sure the camera settings (shutter speed, ISO, EV, White Balance) are adjusted so that no pixels reach the maximum pixel value. If a pixel would normally be higher than the max value the information will be lost. Here are the recommended settings to use (required if not using our reflectance calibration target):

DJI X3 NDVI (Red+NIR):

Photo Mode: DNG+JPG

Shutter Speed: 1/4000s

ISO: 100

Ev: 0

White Balance: Custom 

Color: DNG/None

DJI Phantom 4/3 NDVI (Red+NIR):

Photo Mode: DNG+JPG

Shutter Speed: 1/1000s

ISO: 100

Ev: 0

White Balance: Custom 

Color: DNG/None

You may notice that the images from the DJI cameras with the above settings seem dark. This is normal as we have set the default settings to keep the pixels from reaching the max value. Remember, you are capturing a percent of reflectance not making a "pretty picture".

That brings us to calibration. Just because we have captured a percentage of reflectance in each pixel, how do we know if it is correct? The DJI cameras are not "calibrated" from the factory for reflectance calibration. We need something then to calibrate each pixel using a known reflectance value. We do this by capturing a photo of our MAPIR Camera Reflectance Calibration Ground Target Package just before each survey, which contains 3 targets that have been measured at incremental wavelengths by a spectrometer (a calibrated lab instrument). The pixel values of the captured target image are then compared with the known reflectance values of the targets. Using this information in our MAPIR Fiji plugin we then transform the pixel values and thus calibrate the survey images.

Once the images are calibrated you can stitch them together into a single image called an ortho-mosaic, or "ortho" for short. The resulting ortho images can then have some indice calculations performed on the pixels to produce different types of analysis.

The normalized difference vegetation index (NDVI) is the most common analysis and compares reflected red and near infrared (NIR) light to assess where plants are most "healthy". We assume that given a sample area of a single crop, the plants which are reflecting more NIR light will be performing more photosynthesis and thus are healthier (and vice versa). If a certain region of plants have a NDVI value that is higher (values range from -1 to +1), then the plants are likely healthier there. No matter what index analysis you perform it is vital that you also physically inspect the subject area to verify your results, a process commonly called "ground truthing".

 

How To Calibrate Your Images

 

After you have pre-processed your images (namely converted the DNGs to TIFFs) in our MAPIR Fiji plugin you will want to calibrate them. Opening Fiji select Plugins > MAPIR > Calibrate Images From Directory:

In the dialog window that pops up, select your camera model from the drop-down menu.

If the ortho-mosaic creation software requires JPGs make sure to check the "Convert Calibrated TIFFs to JPGs" box.

If you have an image of the MAPIR Camera Reflectance Calibration Ground Target Package taken just before your survey (recommended) then make sure to check the "Calibrate with MAPIR Camera Reflectance Ground Target Image" box.

Click the "Begin" button to proceed to the next step.

The "Select First Image in Directory to Calibrate" dialog window pops up next:

Select the first image in directory you want to calibrate and click the "Open" button.

If you chose earlier to supply a Reflectance Calibration Target image it will ask you for it depending on the image format the first image in the previously selected directory was:

Since we chose a directory of TIFF images it asks us for a TIFF format calibration target image. You can see the survey images were sorted manually into a "not used" folder which contained the "take-off" and "return to launch" images. The first couple of images will likely contain the requested calibration target.

Clicking the "Open" button will begin the detection of the QR code in the calibration target image. If the QR code is not able to be detected it will prompt you to supply another image. If none of the images are able to be used to detect the QR code the program will automatically use the hard-coded values we supply which are taken during a clear sunny day. There may be a slight inaccuracy if the hard-coded values are used so make sure to capture a few good images of the target shortly before your survey for the best results.

After the plugin has obtained the necessary calibration values it will proceed with calibrating each photo in the directory. If you selected to convert the TIFF images to JPG then separate folders will be created for each image format. If the input directory already has a folder named "Calibrated" it will create a new folder (Calibrated_#) so your images are never over-written.

 

Further Processing Calibrated Images

 

Each pixel in the images now represents a percentage of reflectance for the photographed area. They may be dark (not bright), but don't worry this is normal. Remember, you are capturing reflectance information, not a 'pretty picture".

You will now want to upload the images to the software you are choosing to generate the ortho-mosaic image. 

Drone Deploy supports our NDVI (Red+NIR) filter setup and it's an easy way to get calibrated NDVI results.

If you are not processing your images in Drone Deploy, you will need to stitch the ortho-mosaic using your own software and then process the NDVI index yourself. The reflected red light will be in the image's red channel and the reflected NIR light will be in the blue channel. Using the NDVI formula you will then create the black and white index image:

So the formula in the rastor calculator will look something like: ndvi = (blue-red)/(blue+red). Where blue is the 3rd RGB image channel and red is the 1st RGB image channel.

 

Here are some further examples:

 

Camera: DJI Phantom 3 - 3.97mm NDVI (Red+NIR)

Ortho Software: Drone Deploy

Signup for Awesome

Enter your email address for stock alerts, discounts, promotions and more!

SEARCH THIS STORE

-->