Ask Your Question
0

Applying NDVI indicator on JPEG images in Android using OpenCV

asked 2017-01-30 04:20:19 -0600

I am a beginner in image processing. I have a set of survey images of a farm which I have stitched (eliminating the overlap) and the result is one single image (JPEG) of the entire farm. I want to apply different algorithms on this image for analysis. I want to apply the NDVI index on this farm image and for that I need to do raster calculations.

Can someone tell me the workflow or the steps that I will need to perform to produce a NDVI image of the farm in Android using OpenCV?

Is it possible by OpenCV? If not, what are the other ways to produce this output in Android?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-01-30 05:19:04 -0600

LBerger gravatar image

updated 2017-01-30 05:20:02 -0600

yes it's possible to calculate a ratio by pixel using opencv

      Mat bgr;

     ....
      vector<Mat> p;

       split(bgr, p);

        Mat num;
        subtract(p[0], p[2], num,Mat(),CV_32F);
        Mat den;
        add(p[0], p[2], den, Mat(),CV_32F);
        Mat ratio;
        divide(num, den, ratio,CV_32F); // and hope that den is never equal to 0. you can add 0.01 to den

Now about NDVI : p[0] is NIR and p[2] is visible but is it true for your sensor?

edit flag offensive delete link more

Comments

For pictures taken by our camera, NIR is present in blue channel of the image. It is not available separately.

harsh1411 gravatar imageharsh1411 ( 2017-02-01 03:33:13 -0600 )edit

then you can use this answer

LBerger gravatar imageLBerger ( 2017-02-01 13:28:33 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-01-30 04:20:19 -0600

Seen: 387 times

Last updated: Jan 30 '17