cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Newbie
Newbie
8,003 Views
Registered: ‎11-27-2015

dislpay image on monitor

Jump to solution

I am trying to implement contrast stretching algorithm on Spartan 3 (Using Xilinx 13.4). I just wanted know if it is possible to get contrast enhanced image as output( ie display it) by just using the simulator. So far as simulation is concerned my outputs are the modified pixel values written onto a text file, which I later convert into an image using MATLAB. Is it possible to directly convert these modified pixels into image at the output of the simulator, avoiding MATLAB or any means to integrate both(MATLAB and ISE simulator)? 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Teacher
Teacher
15,434 Views
Registered: ‎03-31-2012

fopen("wb") creates a binary file and fwrite("%u". ....) writes raw data of the item to the file. The combination of these two allow you to create a binary image file. This document http://www.w3.org/Graphics/GIF/spec-gif89a.txt specifies what a GIF file looks like and a basic one is pretty simple to generate (fixed header, no palette etc.). One should be able to develop a verilog gif writer in a day or so.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.

View solution in original post

0 Kudos
4 Replies
Teacher
Teacher
7,992 Views
Registered: ‎03-31-2012

I guess you are using ise so systemverilog is out but you still can write an image file using verilog fwrite etc. functions. Some image files are not very complicated and it doesn't make much code to generate them.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Highlighted
Advisor
Advisor
7,981 Views
Registered: ‎04-26-2015

As Muzaffer has said, you can just have it write images. Not much good for video, but a simulation won't produce good video anyway (it'll take ages to do a single frame). I strongly recommend having a look at the PGM (greyscale) and PPM (colour) image formats; they're human-readable and trivial to export manually.

0 Kudos
Highlighted
Newbie
Newbie
7,976 Views
Registered: ‎11-27-2015

@muzaffer

As you rightly pointed out I'm not working on system verilog. Can you please elaborate a bit more on using fwrite.So far I've written the pixel values onto a text file using fwrite. Now how do I proceed with generating an image out of this text file. Could you please suggest how do I go about with writing the code to achieve this. 

0 Kudos
Highlighted
Teacher
Teacher
15,435 Views
Registered: ‎03-31-2012

fopen("wb") creates a binary file and fwrite("%u". ....) writes raw data of the item to the file. The combination of these two allow you to create a binary image file. This document http://www.w3.org/Graphics/GIF/spec-gif89a.txt specifies what a GIF file looks like and a basic one is pretty simple to generate (fixed header, no palette etc.). One should be able to develop a verilog gif writer in a day or so.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.

View solution in original post

0 Kudos