1 / 4

RGB to YUV CDFG

RGB to YUV CDFG. 林孟諭 Dept. of Electrical Engineering National Cheng Kung University Tainan, Taiwan, R.O.C. C program. void main(void) { int a, b, c; … RGB_2_YCrCb ( I_Frame , O_Frame ); … } void RGB_2_YCrCb ( I_Frame , O_Frame ) { int y, cb , cr ;

shaman
Download Presentation

RGB to YUV CDFG

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. RGB to YUV CDFG 林孟諭 Dept. of Electrical Engineering National Cheng Kung University Tainan, Taiwan, R.O.C

  2. C program void main(void) {int a, b, c; … RGB_2_YCrCb( I_Frame, O_Frame); … } void RGB_2_YCrCb (I_Frame, O_Frame) { inty, cb, cr; for each pixel (a, b, c) in I_Frame do { y =0.257*a + 0.504*b + 0.098*c + 16; cb = -0.148*a -0.291*b + 0.439*c + 128; cr = 0.439*a -0.368*b -0.071*c + 128; write (y, cr, cb) to O_Frame; } } // Y: black-white component, UV: color differences

  3. Single Operation description begin Py= a* 0.257; // 1 Qy= b* 0.504; // 2 Ry= c* 0.098; // 3 Sy= Ry+ 16; // 4 Ty= Py+ Qy; // 5 y = Sy+ Ty; // 6 Pcb= a* -0.148; // 7 Qcb= b* -0.291; // 8 Rcb= c* 0.439; // 9 Scb= Rcb+ 128; // 10 Tcb= Pcb+ Qcb; // 11 cb = Scb+ Tcb; // 12 Pcr= a* 0.439; // 13 Qcr= b* -0.368; // 14 Rcr= c* -0.071; // 15 Scr= Rcr+ 128; // 16 Tcr= Pcr+ Qcr; // 17 cr = Scr+ Tcr; // 18 end

  4. CDFG b a c 128 a 0.257 b 0.504 c 0.098 16 a -0.148 b -0.291 c 0.439 a 0.439 b -0.368 c -0.071 128 * * * * * * * * * Py Qy Ry Pcb Qcb Rcb Pcr Qcr Rcr + + + + + + Ty Tcb Tcr Sy Scb Scr + + + y cb cr

More Related