UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Moderator
Moderator
1,124 Views
Registered: ‎11-09-2015

Video Beginner Series 11: From Sensor output to RGB image

Introduction

 

This Video Beginner Series 11 explains how an output from a sensor is converted to a RGB image

 

2.png

 

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Summary

 

1. Introduction Color Image sensors

2. Tutorial - Using the Sensor Demosaic IP

3. What next?

 


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
3 Replies
Moderator
Moderator
1,121 Views
Registered: ‎11-09-2015

Video Beginner Series 11 - Introduction Color Image sensors

Introduction Color Image sensors

 

 

Introduction to image sensors

 

An image sensor is an electronic device that receive light to electric signals. There are two main types of image sensors: Charged-Coupled Devices (CCD) sensors and Complementary Metal-Oxide Semiconductor (CMOS) sensor.

 

A sensor is an array of pixels. A pixel can be compared to well which collects photons (light information) for a certain amount of time called exposure time.

3.png

 

At the end of the exposure time, the more photon each pixel gets the higher will be the output value for this pixel.

 

4.png

 

Color image sensor

 

To add color information, the sensor uses a Color Filter Array (CFA). On each pixel a filter with a specific color is applied. There are different CFA filters used as the Bayer filter (most commonly used), the RGBE filer, the CYYM filter or the CYYM filter.

 

5.png

 

Thus, each pixel will only receive photons corresponding to one specific color

 

2.png

 

At the sensor output, for each pixel, you get a single value for this specific color. In a RGB image, each pixel has three values, one for each component (one value for Red, one value for Blue and one value for Blue). To create a RGB image from the sensor output, the missing value needs to be computed. This computation is called demosaicing (or sometimes deBayerization because of the Bayer filter).

 

 

Demosaicing with Xilinx devices

 

For the demosaicing images captured with a Bayer image sensor with Xilinx devices, users can use the Sensor demosaicing IP (PG286).

 

 


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
Moderator
Moderator
1,113 Views
Registered: ‎11-09-2015

Video Beginner Series 11 - Tutorial - Using the Sensor Demosaic IP

Tutorial - Using the Sensor Demosaic IP

 

Note 1: This tutorial is intended to be used only with Vivado 2018.1 and only in simulation

Note 2: A valid license for the Test Pattern Generator is required to build the design.

 

Analyzing Bayer images

 

  1. Download the tutorial files and unzip the folder
  2. Open the image file XVES0011/img/bayer_img_1.png. This image represents what an output from a color sensor can look like (only one value per pixel (one color), the others are set to 0). If we zoom in, we can clearly see the Bayer CFA. We can note that the first pixel (top left corner) is a red pixel

 6.png

 

  1. Open the image file XVES0011/img/sensor_img_1.pgm with GIMP. This is the same image as bayer_img_1.png but with only one component per pixel. This is the image we will use for our simulation.

    7.png

Build the Vivado project

  1. Open Vivado 2018.1

  2. In the tcl console, cd into the unzipped directory (cd <path>/XVES_0011)

  3. In the tcl console, source the script tcl (source ./create_proj.tcl)

  4. add the image file sensor_img_1.pgm to the simulation sources (Add sources > Add or create simulation sources > Add files > File of types: All Files)

 

Analyze the design

 

  1. Open the Block Design
    1.png

  2. We can see that the design gets Video data as input (Bayer data) and output video data (RGB data) converted by a Sensor Demosaic IP

  3. The Sensor Demosaic IP needs to be configured and started. The configuration set the fame size and the Bayer Phase (refer to for PG286 detail on the configuration). In this simulation, the Sensor Demosaic IP is configured by an AXI VIP IP. The Bayer phase specify the starting position of the Bayer filter on the sensor. There are 4 different configurations. In our case we are in the configuration 0.

    8.png

Run the simulation

  1. Lunch the behavioral simulation and run it for 50ms.

  2. On the waveform, we can see that the input data width is 8 bits (1 component per pixel) while the output data width is 24 bits (3 components per pixel)

 

  1. When the simulation is finished, open the output image file XVES_0011/proj_1/proj_1.sim/sim_1/behave/xsim/demosaic_RGB.ppm with GIMP. We can see that we have now a RGB image

 9.jpg

 

15. Close the simulation and the project

 

 


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Moderator
Moderator
1,110 Views
Registered: ‎11-09-2015

Video Beginner Series 11 - What Next?

What Next?

 

 

  • You liked this Video Series?
    • You can give Kudos using the Kudos button  kudos.PNG
    • Make sure you are following the Xilinx Video Series topic to be informed when an new topic is published (Go to the Xilinx Video Series topic > Options > Subscribe)

subscribe.PNG


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**