Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

2 Ansichten (letzte 30 Tage)
BUGATHA VARALAKSHMI
BUGATHA VARALAKSHMI am 23 Mär. 2017
Geschlossen: MATLAB Answer Bot am 20 Aug. 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);

Antworten (1)

Walter Roberson
Walter Roberson am 23 Mär. 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.

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by