Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

please provide with the color identification base paper for the following code

2 vues (au cours des 30 derniers jours)
BUGATHA VARALAKSHMI
BUGATHA VARALAKSHMI le 23 Mar 2017
Clôturé : MATLAB Answer Bot le 20 Août 2021
a=0;
b=0;
c=0;
p=0;
p1=0;
I=imread('E:\projectimages\imgs\clg.jpg')
imshow(I)
fnam=imread('E:\projectimages\imgs\clg.jpg');
figure,imshow(fnam)
for mm = 1:size(fnam,1)
for nn = 1:size(fnam,2)
if (fnam(mm,nn,2)) > fnam(mm,nn,1) && (fnam(mm,nn,2)) > 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) = 0;
fnam(mm,nn,2) = 0;
fnam(mm,nn,3) = 0;
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 (1)

Walter Roberson
Walter Roberson le 23 Mar 2017
There is no "paper" for that. The code just extracts the pixels for which the green component is greater than the red or blue, and calls those pixels "vegetation". That is not a robust way to calculate vegetation. For one thing, it leaves out all brown, but a lot of wood is brown.

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by