function result_status = drone_index_2(r,nir,redge, index)

pkg load image

rImg = imread(r);
rImg = single(rImg);

nirImg = imread(nir);
nirImg = single(nirImg);

redgeImg = imread(redge);
redgeImg = single(redgeImg);

ndviImg = (nirImg-rImg)./(nirImg + rImg);
size(ndviImg)

ndreImg = (nirImg-redgeImg)./(nirImg + redgeImg);

size(ndreImg)
ndviName = strcat('drone_ndvi/',index);
ndviName = strcat(ndviName,'.tif');

ndreName = strcat('drone_ndre/',index);
ndreName = strcat(ndreName,'.tif');

index_new = ndviImg;
imgCMP = gen_map1_img(index_new);
imwrite(uint8(imgCMP),ndviName);


index_new = ndreImg;
imgCMP = gen_map1_img(index_new);
imwrite(uint8(imgCMP),ndreName);



result_status = "successful";
end