Advertisement
Guest User

xyz2rgb

a guest
Oct 28th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.35 KB | None | 0 0
  1. function Irgb = dos_xyz2rgb(Ixyz, primaries, white, tf_params)
  2.  
  3. Ixyz = im2double(Ixyz);
  4.  
  5. X = Ixyz(:,:,1);
  6. Y = Ixyz(:,:,2);
  7. Z = Ixyz(:,:,3);
  8.  
  9. R = primaries.R;
  10. G = primaries.G;
  11. B = primaries.B;
  12.  
  13. Irgb = zeros(size(Ixyz));
  14. Irgb(:,:,1) = R(1)*X + R(2)*Y + R(3)*Z;
  15. Irgb(:,:,2) = G(1)*X + G(2)*Y + G(3)*Z;
  16. Irgb(:,:,3) = B(1)*X + B(2)*Y + B(3)*Z;
  17.  
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement