MATLAB: Modifying the NDVI Values Using Multispectral Images

Image Processing Toolboxndvithreshold

Can I determine the minimum and maximum value of the NDVI variable? How do I make a threshold for example higher or equal to 0.3 are green and lower than that are red? Can I make bounding box for the specific pixels that has low values?(but in the plant area, not the road or things that are not vegetation)
Below is the code I used to compute :
R = imread('RED.TIF');
NIR = imread('NIR.TIF');
NDVI = (double(NIR) - double(R)) ./ (double(NIR) + double(R));
imshow(NDVI, []);

Best Answer

Try this:
maxValue = max(NDVI(:))
minValue = min(NDVI(:))
binaryImage = NDVI > 0.3;
You might also be interested in my interactive thresholding app in my File Exchange.