cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining image using STM3220G-EVAL

abhilashajain139
Associate
Posted on October 13, 2014 at 16:30

Hello,

I'm using the STM3220G Eval board and the camera (OV2640) present on the eval board to obtain a RGB image on MATLAB.

The image mode is set to QVGA. As per standard, the image size of QVGA is 320X240 pixels, but when we run DCMI+DMA code on the STM, the V-sync line goes low after obtaining 320*240*2 number of bytes. That means we're getting twice the amount of data than we should actually.

Now, this data is stored in the external SRAM using FSMC and then sent to the PC using UART. After obtaining this data on MATLAB, while displaying it there's an issue since we have twice the data than we should. Trying multiple approaches, we got the following image after omitting every alternate pixel.

First image shows every odd pixel and second image shows every even pixel. Also we've displayed this gray-scale format not RGB.

0690X00000605YlQAI.png 0690X00000605YqQAI.png

Also looking at the example code to initialize the camera, we are not able to tell which image format is QVGA in. Reading the camera datasheet has not been much help either.

Can someone guide us on what format the camera is set to? And how to interpret the data.

Thanks!

P.S. Also attached is the source code. 

1 REPLY 1
stm322399
Senior
Posted on October 13, 2014 at 17:48

IT is likely that every pixel from your sensor is send using two bytes. Encoding may vary depending configuration.

As for an example, you can get RGB data organized as RRRRRGGG and GGGBBBBBB.