Analysis of crop health using NDVI (Red and Near-infrared capturing camera)

Hello Wolfram Community,

I want to take pictures of crops using a drone and better highlight the contrast between regions of healthy vegetation vs. areas with stressed/diseased or no vegetation (in future, extract more information about the crops).

I have recently removed an infrared blocking filter from a camera of a DJI Phantom 3 and instead mounted a filter that blocks every wavelength except Red and Near-infrared. I want red and near-infrared light because healthy vegetation will absorb red light and strongly reflect near-infrared light.

Incorporation of this filter allows reflected red light (660nm) to be captured in the camera sensor’s red channel and reflected near-infrared light (850nm) to be captured in the sensor’s blue channel (the green channel is not used). NDVI can be determined by performing the calculation: NDVI = (blue – red) / (blue + red).

Could you please tell me how to make a heat map (maybe using DensityPlot) or any other way to better highlight the contrast instead of the Colorize function? Or if anything comes to your mind, I would be glad to hear!

This is my first attempt in post-processing.

An approximate regular camera picture of the grass spot:

ColorSeparate[


, {“R”, “B”}]

Out1 = {


,

}

f[pixel1_, pixel2_] := (((pixel1 - pixel2)/(pixel1 + pixel2)) + 1)/2;

ImageApply[f, {


,

}]

Out3 =

The darker spots are supposed to be less healthy vegetation.

Colorize[


]

Out4 =

Nice project, Zhamilya! The image obtained with the filter seems to have an optical aberration on the borders. Cropping the borders of the image with ImageCrop will get you better result:

Colorize[ImageApply[f, ColorSeparate[imgCropped, {"R", "B"}]], 
 ColorFunction -> "ThermometerColors"]

Another observation is that your grass image contains several types of plants that could alter your results. You could try to highlight these plant species directly using your raw image (without red filter). For example you can experiment a bit with ClusteringComponents, MorphologicalComponents, ref/WatershedComponents, DominantColors functions:

Colorize[ClusteringComponents[img, 4] , ColorFunction -> "Rainbow"] 

By the way, some time ago @Arnoud Buzing analysed crops by drone too. You can check his cool post here: Analyzing Crop Yields by Drone

Keep us updated on the progress of your exciting project :slight_smile:

Thank you very much for suggestions, Jofre! I will experiment with ClusteringComponents, MorphologicalComponents, ref/WatershedComponents, and DominantColors functions.