function [G Y]= delE94(gren, yelow, laf) %D5

green = rgb2lab(gren);
yellow = rgb2lab(yelow);
leaf = rgb2lab(laf);
% 
% green= meanCircle(green);
% yellow= meanCircle(yellow);
% leaf = mean_leaf(leaf);

delLg = green(1) - leaf(1);
c1g = sqrt(green(2)^2 + green(3)^2);
c2g = sqrt(leaf(2)^2 + leaf(3)^2);
delCg= c1g-c2g;

dela_g= green(2)-leaf(2);
delb_g= green(3)-leaf(3);
k_l= 1;
k1 = 0.045;
k2 = 0.015;
sl= 1;
sc = 1+k1*c1g;
sh = 1+k2*c1g;

delH_g = sqrt(dela_g^2 + delb_g^2- delCg^2);

d1 =sqrt((delLg/k_l * sl).^2 + (delCg/sc).^2 + (delH_g/sh).^2) ;


%yellow
delLy = yellow(1) - leaf(1);
c1y = sqrt(yellow(2)^2 + yellow(3)^2);
c2y = sqrt(leaf(2)^2 + leaf(3)^2);
delCy= c1y-c2y;

dela_y= yellow(2)-leaf(2);
delb_y= yellow(3)-leaf(3);
k_l= 1;
k1 = 0.045;
k2 = 0.015;
sl= 1;
sc = 1+k1*c1g;
sh = 1+k2*c1g;

delH_y = sqrt(dela_y^2 + delb_y^2- delCy^2);

d2 =sqrt((delLy/k_l * sl).^2 + (delCy/sc).^2 + (delH_y/sh).^2) ;


G = 100 *(1- (d1/ (d1+d2)));       %Green percentage
Y = 100 *(1- (d2/(d1+d2)));        %Yellow percentage
