How to use OpenCV with Raspberry Pi CSI camera

by viilaamo.com

Introduction

Raspberry Pi CSI onboard camera can provide also RAW image data in BAYER format

The camera has now raw mode working which we will use to get the raw data. The raw data is in Bayer format.

front page image

Getting the hardware together was pretty easy, just plug the flex cable to the CSI camera connector with the blue tab facing towards to the ethernet cable connector.

HW image

We used the sources from raspistill and did modifications to just capture raw and store the raw into a buffer.

We took the latest version of OpenCV (2.4.5) and created a single plane matrix where we copied the raw data.

After generating the colors the image can be stored and viewed easily, without color generation it is kind of hard to investigate the image.

© viilaamo.com