Subscribe to EDN
RSS
Reprints/License
Print
Email

Converter translates Bayer raw data to RGB format

Convert data to a more usable format.

Yu-Chieh Chen and Tai-Shan Liao, National Applied Research Laboratories, Hsinchu, Taiwan; Edited by Martin Rowe and Fran Granville -- EDN, February 4, 2010

PDF

 Read More
Design Ideas

CMOS image sensors include the color filters of an RGB (red/green/blue) Bayer array, which lets the sensor detect colors. The image data, the
output from the image sensor, is Bayer raw data (Figure 1). Unfortunately, most consumer-grade image-displaying devices require an RGB-image-data format with red, green, and blue in each pixel’s data. Therefore, you often need a Bayer-raw-data-to-RGB converter between an image sensor and a displaying device. This Design Idea describes such a converter in Verilog HDL (hardware-description language). Click here to download the code to implement into a CPLD or an FPGA.

Converter translates Bayer raw data to RGB format figure 2

To make the design easy to understand, the RGB data is only 24 bits deep. A 320×240-pixel test-bench pattern verifies the design (Figure 2). The image data for red, green, and blue are 88h, 66h, and 22h, respectively. Figure 3 shows the timing of the converter, and Figure 4 shows the flow chart. In Figure 3, the PCLK (processor-clock) signal’s rising edge latches the 24-bit RGB data. Converter translates Bayer raw data to RGB format figure 3The LVAL (line-valid) cap signal is the synchronized line-valid signal for reading the data. The process begins when the FVAL (frame-valid)-data signal goes high. When that action occurs, sensor data begins writing to FIFO1 (first-in/first-out), FIFO2, and the data register. After saving the data, FIFO1 reads out the data. FIFO2 and the data register read their data at the same time. Those readouts occur one clock cycle after FIFO1 starts reading. The next 24-bit RGB data remains the same in the data register, and it combines the data from FIFO1 and FIFO2, which read out at the same rising edge of the clock. The line-count signal shows whether the data is even or odd, which influences the combinational sequences of the data that reads out from FIFO1, FIFO2, and the data register.

Figure 5 is the ModelSim simulation waveform of the converter. The 24-bit RGB output-data values 88h, 66h, and 22h are red, green, and blue data, respectively. The figure shows the 24-bit RGB data as having red, green, and blue values of 88h, 66h, and 22h, respectively, during every line-data period. The line-data period matches the default pixel value in the image data’s test-bench pattern.

RSS
Reprints/License
Print
Email
Talkback
Canon Resource Center

Featured Company


Most Recent Resources

Advertisement
Related Content

No related content found.

  • 0 rated items found.
Advertisement

KNOWLEDGE CENTER

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
Engineering Careers
Jobs sponsored by
Advertisement
About EDN   |   Site Map   |   Contact Us   |   Subscription   |   RSS
© 2012 UBM Electronics. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other UBM Canon sites

UBM Canon | Design News | Test & Measurement World | Packaging Digest | EDN | Qmed | Pharmalive | Appliance Magazine | Plastics Today | Powder Bulk Solids | Canon Trade Shows