Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

GrayScale from RGB

Hello everyone i bought the Terasic 5MP Camera to do some image processing inside but i am kinda lost in the Verilog..

For example, i have

                        //    FIFO Write Side 1
                            .WR1_DATA({1'b0,sCCD_G,sCCD_B}),
                            .WR1(sCCD_DVAL),
                            .WR1_ADDR(0),
                            .WR1_MAX_ADDR(640*480),
                            .WR1_LENGTH(9'h100),
                            .WR1_LOAD(!DLY_RST_0),
                            .WR1_CLK(~CCD_PIXCLK),
                            //    FIFO Write Side 2
                            .WR2_DATA(    {1'b0,sCCD_G,sCCD_R}),
                            .WR2(sCCD_DVAL),
                            .WR2_ADDR(22'h100000),
                            .WR2_MAX_ADDR(22'h100000+640*480),
                            .WR2_LENGTH(9'h100),
                            .WR2_LOAD(!DLY_RST_0),
                            .WR2_CLK(~CCD_PIXCLK),

I can see that green red and blue channels are there and they are connected to the VGA OUTPUT.

The system is working perfectly well in my DE2, however i want to transform it to a grayscale image instead of RGB

I dont want to use floating points so i will use a simplification like channel = red+2*green+blue

how can i do that in Verilog?? I am really lost..

thanks

11 Replies