Forum Discussion
Altera_Forum
Honored Contributor
15 years agoGrayScale 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 ...
Altera_Forum
Honored Contributor
15 years agoUse the following code:
module rgbtoy(r,b,g,y);input [9:0] r,b,g;
output [9:0] y;
//y=0.299r+0.587g+0.114b;
assign y = (r>>2)+(r>>5)+(g>>1)+(g>>4)+(b>>4)+(b>>5);
endmodule