Precise Screen and Video Capture

I’m trying to write a program that will be capable of tracing any pixel back to the original object coordinates. (If there is a program/library/etc. that does this already please shut me up now and I’ll stop reinventing the wheel :slight_smile: ) However the pixel coordinates need to come from a saved rendering (in a bitmap or any format that is easy to save to) and the few ways I’ve seen to save a rendering do not discuss whether they are accurate to the original screen.

Also, I need to extend this later into recording multiple frames (perferably video) that are also precise. I know recording is possible (Quake III) but I do not know how feasible it is.

This all has to be very precise because it will act as ground truth data for image processing algorithms.

Thanks,
Colby

It can be done accurately if you know the viewing parameters. Things like the original frustum and camera position. A lot of the difficult work is in figuring out those things if you don’t have them.

There is a lot of published research on this kind of thing.

My main concern is 1) how should I output the rendering for best results and 2) do I merely need to adjust the viewport transformation to get accurate correlations between the pixel coordinates and the object coordinates (given that I know all the stages between the viewport transformation and object coordinates).

Thanks,
Colby

Yes, you have all you need. OpenGL even defines the exact pixel mapping w.r.t. viewport edges in the spec.

Make a glReadPixels call and write with your non lossy format of choice.