Effacer les filtres
Effacer les filtres

i can find out the amount of greenness for the image using the below code...How can i find out the greenness using ndvi

1 vue (au cours des 30 derniers jours)
a=0; b= 0; c=0; p=0; p1=0;
%pic=sprintf('E:\PPTFILES\img-thing.png') fnam=imread('E:\PPTFILES\images.png'); for mm = 1:size(fnam,1)
for nn = 1:size(fnam,2)
if (fnam(mm,nn,2) -10) > fnam(mm,nn,1) & (fnam(mm,nn,2)-10) > fnam(mm,nn,3) fnam(mm,nn,1) = fnam(mm,nn,1); fnam(mm,nn,2) = fnam(mm,nn,2); fnam(mm,nn,3) = fnam(mm,nn,3);
a=a+1;
else fnam(mm,nn,1) = 250; fnam(mm,nn,2) = 250; fnam(mm,nn,3) = 250; b=b+1;
end
end
end
p = a / (a + b);
p1 = p * 100;
imshow(fnam); a = sprintf('Vegetation Pixel Count= %3d',a); b = sprintf('Non Vegetation Pixel count= %3d',b); c = sprintf('Percentage of area of veg is %3f %',p1); msgbox(a); msgbox(b); msgbox(c);

Réponses (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by