Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21615 Discussions

How to obtain images from SD-RAM?

Altera_Forum
Honored Contributor II
2,968 Views

I am working on a final year project to detect human figure in an image from cameras using verilog code. The platform used in the project is a DE2 board(Cyclone EP2C35F672C6N) and D5M(camera). 

 

I have succeeded in converting the colored image into gray scale images and display it in a monitor. Now, i would like to read the images from the SD-RAM and apply image processing steps for image analysis. 

 

I am encountering a few problems as below: 

 

1.The images stored in the SD-RAM is constantly changing, meaning that the pixel stored in it will be replaced by new pixel that the camera capture. The camera functions in real time. The camera will obtain images and display them in a monitor in real time. Since i have converted the images to gray scale, the images stored in the SD-RAM is also gray scale. Since R = G= B, I need to read out either one to carry out image processing. How to read out the R or G or B from the SD-RAM? 

 

2. Is it possible to do image processing using verilog coding?  

 

Can anyone please give me some advice or offer some reference for me? I have attached a zip file file for the current project in the post.
0 Kudos
16 Replies
Altera_Forum
Honored Contributor II
1,878 Views

1 - use a technique called double-buffering: capture in one buffer, process in another. When a new frame starts, capture into the second buffer, process the first. Use as many intermediate buffers as you want. 

 

2 - yes, you can do very advanced image manipulation in Verilog. It just depends on the algorithm and how much time you need to spend implementing it whether it's worth it or not. 

 

Best regards, 

 

 

Ben
0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

Thx so much for your advice, Ben!!! Really appreciate it. 

 

I will try to find out more about double buffering and apply it to the design. 

One more challenge is the configuration of the SD-RAM in DE2. I couldn't figure out how to enable read or write SD-RAM 

 

I know that the captured image will be store to SD-RAM memory location: 

00000 H - 4B000 H (R - [9:0], G - [14:10]) * it is in hexadecimal form 

100000 H - 14B000 H (G- [4:0], B - [14:5]) 

 

There is a fifo module that consists of FIFO 1 and FIFO 2 with each fifo containing 16 bit. The data stored in FIFO only requires 15 bit each, therefore 1 bit is put blank(refer to the bracket written in the memory location, there are 15 bits). The 2 fifos will give us 30 bit in total which is 10 bit for R, 10 bit for G and 10 bit for blue.  

 

Since i have ady changed it to gray scale, so the R=G=B. I juz need to read data from memory location 00000 H to 4B000 H (R - [9:0]) for the red part. and then when displaying it to the monitor, i will sub-parallel the green and blue because R=G=B to get back RGB. 

 

The challenge is how to create a module that is able to read data from that particular memory location and store it to register and do image processing before writing it back to a different memory location for further image processing. Please look into the attached file in the post for the current design of the project. 

 

Can you provide me with some guidance and possibly some references or documentation. Your help would be highly appreciated. Thanks in advanced.
0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

hi lgsl88,  

i have a edge detection project that is implemented in DE2 board and it uses 1.3MP camera module...... 

 

 

Will it b useful to you???
0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

Check out Cornell University for sample projects

0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

thanks for the info bro.. 

 

I did search for the project but it doesn't share any coding or modules... 

 

Please help urgently if possible.. 

 

JZK
0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

What board you are using and which camera module u have?

0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

its a VGA camera (640x480) and the board is Altera DE2 70 i need to create take input from video in and do image detection..for tracking an object...colour or black and white..

0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

..I have my own soft core processor and the interface is different than Avalon bus and I have very little time to port all the interface... 

 

JZK
0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

Sorry bro i dnt knw much abt de2 70......i have worked oly wit de2. 

Anyway do u use any camera like terrasic supported camera(1.3MP,5MP),that can be interfaced with the GPIO ?
0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

DE2 and DE2 70 are not much different for basic fwatures.. if you could extend any help based upon DE2 that would be appreicated.. 

 

as I wrote earlier I do not have a camera module...rather I m trying to get the video from video in of the board with a VGA (640x480) camera with video out. 

 

thanks
0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

in this site there is a project that uses video as input 

http://www.cs.columbia.edu/~sedwards/classes/2010/4840/index.html
0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

Hi, 

I am using DE2-70 board with TRDB-D5M camera and TRDM-LTM (touch module) to display the image captured by the camera. I have used the reference design for the image dispaly.  

How can i do image processing? How do i use SDRAM for the image enhancement. Any algorithm or idea is appreciated.
0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

Hi, 

i am using Terasic 5MP Camera with LCD touch panel and DE2-70 board. I am able to capture the image and display it on LCD. Now i need to retrieve that image from the SDRAM and do edge detection. How do i know the memory location for that image (RGB). How can i save it to another register?
0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

Hi Vachi, 

 

I am also trying to do edge detection using de2. would you mind sharing your code or resources.
0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

I have a question, is your project reading an image and displaying it using the VGA? thanks. 

 

 

 

 

 

 

--- Quote Start ---  

I am working on a final year project to detect human figure in an image from cameras using verilog code. The platform used in the project is a DE2 board(Cyclone EP2C35F672C6N) and D5M(camera). 

 

I have succeeded in converting the colored image into gray scale images and display it in a monitor. Now, i would like to read the images from the SD-RAM and apply image processing steps for image analysis. 

 

I am encountering a few problems as below: 

 

1.The images stored in the SD-RAM is constantly changing, meaning that the pixel stored in it will be replaced by new pixel that the camera capture. The camera functions in real time. The camera will obtain images and display them in a monitor in real time. Since i have converted the images to gray scale, the images stored in the SD-RAM is also gray scale. Since R = G= B, I need to read out either one to carry out image processing. How to read out the R or G or B from the SD-RAM? 

 

2. Is it possible to do image processing using verilog coding?  

 

Can anyone please give me some advice or offer some reference for me? I have attached a zip file file for the current project in the post. 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
1,878 Views

 

--- Quote Start ---  

hi lgsl88,  

i have a edge detection project that is implemented in DE2 board and it uses 1.3MP camera module...... 

 

 

Will it b useful to you??? 

--- Quote End ---  

 

 

Hi.. I am currently doing the similar project in Verilog HDL for Number plate recognition. I feel that your project is helpful to start in many possible ways. Would it be possible for you to mail me your code? It would be of great help.. Many thanks in advance. :)
0 Kudos
Reply