function luv = rgb2luv(rgbinput, rgbwhite)
    rgbinput = rgbinput/255;
    rgbwhite = rgbwhite/255;
       transm = [ 0.412453  0.357580  0.180423 ; 0.212671  0.715160 ...
              0.072169 ; 0.019334  0.119193  0.950227 ];
   input = transm * rgbinput';
   white = transm* rgbwhite';
   %
   X=input(1); 
    Y=input(2); 
    Z=input(3);
    XN = white(1);
    YN = white(2);
    ZN = white(3);
    %
    uprime = 4*X/(X+15*Y+3*Z);
    vprime = 9*Y/(X+15*Y+3*Z);
    unprime = 4*XN/(XN+15*YN+3*ZN);
    vnprime = 9*YN/(XN+15*YN+3*ZN);
    %
     L = 116*((Y/YN)^(1/3)) - 16;
     u = 13*L*(uprime-unprime);
     v = 13*L*(vprime-vnprime);
     luv = [L u v];
end
