Construct RGB pixel data from Bayer pattern pixels
Vision HDL Toolbox / Conversions
The Demosaic Interpolator block provides a Bayer pattern interpolation filter for streaming video data. The block implements the calculations using hardware-efficient, multiplier-free algorithms for HDL code generation. You can select a low-complexity bilinear interpolation, or a moderate-complexity gradient-corrected bilinear interpolation.
When you select bilinear interpolation, the block operates on a 3×3 pixel window using only additions and bit shifts.
When you select gradient correction, the block operates on a 5×5 pixel window. The calculation is performed using bit shift, addition, and low-order canonical signed digit (CSD) multiplication.
This block uses a streaming pixel interface with a
pixelcontrol
bus for frame control signals. This interface enables the
block to operate independently of image size and format. All Vision HDL Toolbox™ blocks use the same streaming interface. The block accepts and returns a scalar
pixel value and a bus that contains five control signals. The control signals indicate the
validity of each pixel and its location in the frame. To convert a frame (pixel matrix) into a
serial pixel stream and control signals, use the Frame
To Pixels block. For a full description of the interface, see Streaming Pixel Interface.
[1] Malvar, Henrique S., Li-wei He, and Ross Cutler. “High-Quality Linear Interpolation for Demosaicing of Bayer-Patterned Color Images.” Microsoft Research, May 2004. http://research.microsoft.com/pubs/102068/Demosaicing_ICASSP04.pdf.