Guest User

Untitled

a guest
May 24th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. function YUV=rgb2yuv(RGB)
  2. R = RGB(:,:,1);
  3. G = RGB(:,:,2);
  4. B = RGB(:,:,3);
  5.  
  6. Y = 0.299 * R + 0.587 * G + 0.114 * B;
  7. U = 0.5 - 0.168736 * R - 0.331264 * G + 0.5 * B;
  8. V = 0.5 + 0.5 * R - 0.418688 * G - 0.081312 * B;
  9. % ^^^ I tried to use 0.0 as well, but SSIM values are identical
  10.  
  11.  
  12. YUV=cat(3,Y,U,V);
  13. end
Add Comment
Please, Sign In to add comment