# Improper Computation of NDVI

I am new to image processing. I am applying NDVI index on an image of an agricultural farm taken by drone. But the formula (NIR-Red)/(NIR+Red) is giving me wrong output (here instead of NIR we are using the blue channel). Then I came to know that the image I am using is taken by camera with NIR sensors. Would the formula differ from normal formula of NDVI?

edit retag close merge delete

1. What does it mean wrong output?
2. "here instead of NIR we are using the blue channel" NIR= near-infrared regions it is not blue channel...
( 2017-02-16 02:52:53 -0500 )edit

@LBerger Ideally when we apply NDVI on imaage plant should colored light grey and ground should colored dark grey. But I am getting reverse.

( 2017-02-16 03:05:30 -0500 )edit

Yes, because you can't just switch the infrared channel with the blue channel!

In the image of a plant, red and blue values are roughly equal (R~B=a). Then the formula will give you (a-a)/(a+a)=0. Hence the dark color of the plant on your image.

One more thing: RGB cameras with IR blocking filter removed (like the Raspberry Pi NoIR camera) won't give you good NDVI.

( 2017-02-16 09:08:31 -0500 )edit

Sort by ยป oldest newest most voted

Ok some replies

here instead of NIR we are using the blue channel

How are you expecting that to work? NDVI only works with NIR information available, not with blue channel information.

the image I am using is taken by camera with NIR sensorsably

Then there should be a NIR channel available. In normal circumstances this imagery is 4 channel data, where the 4th channel has the NIR information.

but the formula (NIR-Red)/(NIR+Red) is giving me wrong output

My best guess, you are running into data range issues, simply dividing integer channel images. Show us your code so we can have a look at what is acually going wrong.

more

Official site

GitHub

Wiki

Documentation