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

312 Views
|
2 Replies
|
5 Total Likes
|
 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"}]Out[1] = { , }f[pixel1, pixel2] := (((pixel1 - pixel2)/(pixel1 + pixel2)) + 1)/2;ImageApply[f, {, }]Out[3] = The darker spots are supposed to be less healthy vegetation.Colorize[]Out[4] =
 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: https://community.wolfram.com/groups/-/m/t/551187Keep us updated on the progress of your exciting project :)