Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

chage of colour in image processing

Status
Not open for further replies.

naresh850

Full Member level 3
Joined
Jun 9, 2006
Messages
157
Helped
6
Reputation
12
Reaction score
4
Trophy points
1,298
Activity points
2,249
Hello,

I would like to chage of colour in image.
My image is in YCbCr(4:2:2) format.

So i need to change the value of Cb and Cr.

Can anybody gives me different value of Cb and Cr for different colour?

Any help would be highly appriciated.

regards
NAresh
 

U CAN SIMPLY USE RGB2GRAY MATLAB COMMAND,RGB2HSI COMMAND
 

hello i m doing all the coding in real time on processor blackfin BF561

I cant use RGB

if you know somtnig about Cb and Cr values for different colours then please let me know
 

use the Gonzal & woods book
Digital Image Processing using matlab
see the chapter color image processing
 

Here is how you can do it.

1. Change YCbCr to RGB using following formula [From Wikipedia]
Code:
8-bit R'G'B' from YCbCr (601)
=====================================================================
R'd = ( 298.082 * Y'                + 408.583 * Cr ) / 256 - 222.921
G'd = ( 298.082 * Y' - 100.291 * Cb - 208.120 * Cr ) / 256 + 135.576
B'd = ( 298.082 * Y' + 516.412 * Cb                ) / 256 - 276.836
.....................................................................

2. Modify the R,G,B values

3. Convert RGB back to YCbCr using following formula
Code:
YCbCr (601) from "digital 8-bit R'G'B'  "
========================================================================
Y' = 16  + 1/256 * (   65.738  * R'd +  129.057  * G'd +  25.064  * B'd)
Cb = 128 + 1/256 * ( - 37.945  * R'd -   74.494  * G'd + 112.439  * B'd)
Cr = 128 + 1/256 * (  112.439  * R'd -   94.154  * G'd -  18.285  * B'd)
........................................................................
R'd, G'd, B'd in {0, 1, 2, ..., 255}
Y'               in {16, 17, ..., 235}
   with footroom in {1, 2, ..., 15}
        headroom in {236, 237, ..., 254}
        sync.    in {0, 255}
Cb, Cr           in {16, 17, ..., 240}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top