Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

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

2 visualizzazioni (ultimi 30 giorni)
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);

Risposte (1)

Walter Roberson
Walter Roberson il 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.

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by