Instructions
- 1
Define a new function named "RGB_to_YCrCB()" in your Java file.
void RGB_to_YCrCB (int[] RGB, int[] YCrCB)
...
Calculate the Y value from RGB using the following conversion.
YCrCb[0] = (int) ( 0.299 RGB[0] + 0.587 RGB[1] + 0.114 * RGB[2]);
3Calculate the Cr value from RGB using the following conversion.
YCrCb[1] = (int) ( -0.16874 RGB[0] - 0.33126 RGB[1] + 0.50000 * RGB[2]);
4Calculate the Cb value from RGB using the following conversion.
YCrCb[2] = (int) ( 0.50000 RGB[0] - 0.41869 RGB[1] - 0.08131 * RGB[2]);
No comments:
Post a Comment