- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Image Processing in Xilinx System Generator - Simple Q.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-24-2010 08:37 AM
Hey folks,
I'm quite embarrassed to actually ask this as it's such a simple task...
I'm new to System Generator and worked through the 7 quick start labs with no problems, but beginning to explore image processing I'm having problems actually processing the data through the gateway IO.
I'm currently working with a simple model where the image is prepared for gateway input and output where no operations occur within the FPGA boundary.
Through reading it is my understanding to prepare the image for passing into the gateway input the image should be:
- Transposed
- Converted from 2-D matrix to 1-D vector
- Converted to frame
- Unbuffered
The data passes into the gateway and back out, but attempting to reconstruct the orginal results in a black screen.
The image reconstruction process is:
- Buffered
- Convert to 2-D matrix
- Transpose data.
The image data being processed is the red component of the peppers.png file provided by Matlab.
Any help to get me on why way will be much appreciated.
Recreational FPGA Explorer.
Solved! Go to Solution.
Re: Image Processing in Xilinx System Generator - Simple Q.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-26-2010 02:30 PM
Take a look at example under $DSP_Tools\sysgen\examples\shared_memory\hardware_
Re: Image Processing in Xilinx System Generator - Simple Q.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-28-2010 08:26 AM
This message was moved by Xilinx Forum Moderator. If you have any questions, please contact Forum Moderator.
Re: Image Processing in Xilinx System Generator - Simple Q.
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-01-2010 08:26 AM - edited 02-17-2011 01:25 AM
I looked at the convolution 5x5 models provided, but they weren't doing what I particularly wanted, I kept getting an error from the shared memory block.
What I've done is have an image broken down to a pixel stream and recompiled with no problems in simulink, but when it passes through the FPGA boundary (Gateways Input and Output) it gives me a black screen. See the attached image for simulation details.
I assumed it was due to numerical error. I tried various bit combinations in the Gateway Input block, but to no avail.
Any help on it would be appreciated.
EDIT:Updated post to help those who are new to System Generator and are having similar problems.
This model works.
The image being processed is a 512x512 greyscale Lenna image, hence only 1 output image component from the image read block. The simulation run time should be set to at least the pixel dimensions of the image processed, where; gateway sampling is 1 and the System Generator token simulink sampling set to 1.
Recreational FPGA Explorer.
Re: Image Processing in Xilinx System Generator - Simple Q.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-11-2011 12:48 PM
Hi, I'm new to System Generator and I have the same problem.
How did you solve this?
Re: Image Processing in Xilinx System Generator - Simple Q.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-11-2011 10:24 PM
Hi
I am not sure but I think there could be a problem of sampling time. If you could just attach your model than the problem could be more easily understood
SALMAN
Re: Image Processing in Xilinx System Generator - Simple Q.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-12-2011 10:41 AM
Forgot I posted this.
Yeah its the sampling time that caused it.
As System Generator is clock cycle accurate you need to assign a simulation run time of (at least) the image dimension, for example if it is a 512 by 512 image then set the simulation run time to a minimum of 512*512.
Recreational FPGA Explorer.
Re: Image Processing in Xilinx System Generator - Simple Q.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-16-2011 04:54 PM
Hi again,
I did what you said and set the simulation run time to 512*512 and greater, but the output is still black.
the system period on the System Generator block is set to 1
the solver type is fixed-step, discrete (no continuous states)
is this ok?
I added a "To Workspace" block at the output to see the actual values and it shows that the output is a 512*512*2 matrix
where the first matrix is full of zeros and the second matrix has the actual image values.
Perhaps the display block is showing the first matrix values..Any thoughts on that?
thanks
Re: Image Processing in Xilinx System Generator - Simple Q.
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-17-2011 01:05 AM - edited 02-17-2011 07:30 AM
The machine I'm currently on doesn't have all the MATLAB toolboxes necessary to give your model a proper examination, so my current help will be quite limited. I'll look at it on another later today.
Is the source image a 512x512 pixel image?
Are you processing an individual image type component (such as the red, green or blue) or is the image read block outputing all RGB components on the same line?
Is the data type conversion to unsigned 8 bit block really neccessary?
Edit:
I ran your model on a machine with the correct MATLAB toolboxes.
I used a 512x512 Lenna image in JPG format.
The image from file was set to a one dimensional signal, you need to process the image components seperately, so change it to produce seperate color signals (R | G | B).
I used a video viewer sink and it produced the image, while the video display sink did not.
Hope that helps
Recreational FPGA Explorer.
Re: Image Processing in Xilinx System Generator - Simple Q.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-18-2011 11:33 AM
Hi,
I used the Video viewer block and it displayed the image.. at last
dont know why the video display block didn't work
anyway, this is enough for my application, thanks a lot for your help











