Images in C

Soldato
Joined
22 Oct 2005
Posts
2,884
Location
Moving...
For an assignment we have to read in 2 jpeg images taken from a stereo camera. It says we can use 'a language of our choice' but we have only covered straight C in any detail. We then need to do some calculations on the images to find the epipolar lines amongst other things. Apparently we only have to read the image in and store the data in a 2D array (quite what we store i'm not sure of), then we can do all the calculations on the array.

My question is does anyone know of a guide or something similar which talks about using images in C? I think it may be easier to do in Java or C# for example but I know only the basics of Java and no nothing about any other language.

Thanks for any help.
 
could be nobody knows, could be nobody wants to do your homework for you :)

it's been a while since i did anything like this so i'll just throw in a couple of ideas rather than try to give specifics (i've probably forgotten all the really relevant info anyway).

you need to read from a jpg file.

right, you've got two choices.

1) use a library to access the files. you'd have to find one that would work, build it alongside your code etc. are you even allowed to do this within the rules of your assignment.

2) read the file yourself. i'd probably do it this way, but it may be the more tricky.
are the jpgs they gave you encoded in a lossy or lossless format (i think jpegs can be either. if they're lossless then this option might be easier.
see K&R for how to access files in C.

oh, and darnit, i just looked for my old machine vision notes and i can't find them so i'm sorry but i can't give you any pointers on the epipolar bit except to say you're gonna need to do edge detection first, and this might or might not be relevent.
 
Last edited:
Hmm I did (i.e. had to do) something similar to this in C a while back, we called "xv"'s imaging libraries from C and worked with bitmap images (in .xpm format IIRC) rather than working with jpegs which will already be compressed using a DCT.
Certainly a bitmap would be easier to work with in terms of each pixel having a specific integer value in a 2D array, which could then have some FFT function performed on it.
 
Back
Top Bottom