Apply NDVI to images with Opencv and Java

Asked

Viewed 384 times

1

Everybody, good afternoon, everybody.

I am in need of an image processing help using the Opencv library. Basically I need to take a satellite image and apply the NDVI (vegetation index by normalized difference) its calculation is simple:

NDVI = (NIR - RED) / (NIR + RED)

Where NIR (Near Infra-Red) is the image of band 5 which is infrared and RED is the image of band 4 which is red.

But after applying this formula I have no results other than a black background image. If anyone can help, worth.

More information on this link: http://www.lac.inpe.br/JIPCookbook/6330-howto-ndvi.jsp

  • Well, I don’t know anything about opencv, so forgive my ignorance, but what is NIR and what is RED? I think it’s important that we know so we can come up with an answer. Also, after the NDVI has been calculated, what exactly do you mean by applying it? What is the algorithm you use to apply the NDVI?

  • NIR = is the near-infrared and corresponds to band 5 of the satellite Landsat 8, RED = is literally red and corresponds to band 4 of the mentioned satellite, APPLY IT = take if the images referring to band 5 and 4 and play in the formula. For the algorithm see this link: http://www.lac.inpe.br/JIPCookbook/6330-howto-ndvi.jsp

  • Cool, you didn’t know this. Can you confirm that Opencv is actually providing you with an image, and not just a bunch of black? Also, it would be interesting for you to post an example image that you want to process as well as your code in Java. That way we can try to find what’s wrong with your code.

  • If you post an image in NIR and one in RED, I cake a program in Java to generate NDVI. :)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.