TAGS :Viewed: 17 - Published at: a few seconds ago

[ Using video/image files in C ]

I'm trying to look through and find a way to annotate a video in C with polygons bounding boxes, however I'm stuck at a very elementary step.

Assuming I know how to break a .MPEG movie up into multiple JPEG images, how do I manipulate that file in C? The things I'll eventually need to draw on are text, points, and lines, but I am having a hard time figuring out how to get started with this.

If I declare:

FILE* img = fopen('foo.jpeg', 'r');

then what could I do with img? Is there a way to access certain pixels in the drawing?

Answer 1


What you did in your code sample is just opening a file. You didn't even read any data from it yet.

The simplest way to load an image file is to use dedicated library, such as SOIL. If you weren't able to do it by yourself, however, I really don't think you will be able to accomplish your project goals - it is really advanced stuff you want to create, and you failed, as you already noticed, on the most basic of steps.