function [G Y]= rgbDifference2(green, yellow, leaf) %D2


d1 = sqrt( 2*(green(1)- leaf(1)).^2 + 4*(green(2) - leaf(2)).^2 + 3*(green(3) - leaf(3)).^2);       % leaf distance from green
d2 = sqrt( 2*(yellow(1)- leaf(1)).^2 + 4*(yellow(2) - leaf(2)).^2 + 3*(yellow(3) - leaf(3)).^2) ;    % leaf distance from yellow

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

