Research Article

Urban Lawn Monitoring in Smart City Environments

Algorithm 1

Part of MATLAB code to extract RGB components.
%Read Picture.
x=imread (picture);
GREEN= x (:,:,3);
[Rows, Columns]= size (GREEN (:,:,1));
%calcule blue histogram
  for f=1:256
    h_G(f)=0;
  end.
  for g=1:Rows.
   for h=1:Columns
    V_Green= GREEN(g,h);
    h_G(V_Green+1)= h_G(V_Green+1)+1;
   end
  end
%Vector of histogram component green.
  His_G=h_G;