-
Loading Images in C
Hi Everyone,
im pretty new to C programming and i was wondering if anyone could help me out. I need to load still images in JPEG format into a C program and after this i need to run things like edge detection and filtering algorithms. I am using the Intel IPP 5.3 package which includes code for the edge detection and filtering but has nothing for loading images into C.
Any advice or ideas??
Thanks
-
libjpeg perhaps?
Also be aware that Intel's code does not work on AMD processors - I don't know if AMD has a similar library, but I know their math libraries for example work just fine (and fast) on Intel processors too.
--
Mats
-
What image format does IPP support? YUV?
-
It supports JPEG, JPEG2000, BMP and YUV. Ideally i would like to keep the images in JPEG format as any sample code which i have access to is in this format, and as i am fairly new to C, i feel that i will probably need these sample codes as guides when it comes to later in the project
-
So presumably, then, you just have to load the image itself into memory. A simple piece of code using fopen() and fread() should do the trick, then. You may need some extra code to figure out the size of the image, but shouldn't be too big an issue.
--
Mats
-
Without understanding the file format all your attempts will still not work. Find some info on the JPEG file format, use GDI+, or use some other thirdy party library to load the image.