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

how to load a image in quartus II tool and convert it into a .dat file

Altera_Forum
Honored Contributor II
2,733 Views

i am doing final year project on image processing and i have to convert a image file into .dat file in quartus II tool so that i can use it as a input to my architecture and project is on image detection method. its very urgent....

0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
1,768 Views

Look up a common image source and figure out how the bits are formatted. I would suggest using either .BMP http://en.wikipedia.org/wiki/bmp_file_format or 

.PPM formats as they are very simplistic 

http://netpbm.sourceforge.net/doc/ppm.html 

 

Then write a conversion program that arranges the bits how you like. 

 

The PPM format you may be able to read directly. 

 

Inkscape is a good GPL program to try to convert from one image format to another. 

 

Python also has image reading routines that can be used to convert image formats. import the image module and you can read several different file formats. 

 

 

Pete
0 Kudos
Altera_Forum
Honored Contributor II
1,768 Views

 

--- Quote Start ---  

Look up a common image source and figure out how the bits are formatted. I would suggest using either .BMP http://en.wikipedia.org/wiki/bmp_file_format or 

.PPM formats as they are very simplistic 

http://netpbm.sourceforge.net/doc/ppm.html 

 

Then write a conversion program that arranges the bits how you like. 

 

The PPM format you may be able to read directly. 

 

Inkscape is a good GPL program to try to convert from one image format to another. 

 

Python also has image reading routines that can be used to convert image formats. import the image module and you can read several different file formats. 

 

 

Pete 

--- Quote End ---  

 

 

i did not understand this. actually i have to convert the image(pixels) into a text file using quartus tool same as how we do using matlab. so that i can use that text file as input for my architecture. can u please help me regarding this problem.
0 Kudos
Altera_Forum
Honored Contributor II
1,768 Views

Quartus won't be able to do that for you, you'll need an external software or a script you make yourself. You can either convert your image to a .mif or .hex text file to use it as initialization contents for a RAM or ROM block generated from the Megawizard, or convert it to a table in a HDL file, either Verilog or VHDL.

0 Kudos
Reply