I'd like to find a library which can do simple but true 3D reverse projection.
Given an image of a flat surface viewed from an arbitrary viewpoint in space, return a flat 2D image with perspective removed, as if the camera had been in the ideal position directly front and centre of the image.
A contrived example:
3D source image "unprojected" to
(Ignore the overlaid rectangle on the latter, I'm just using the first images I can find so far.)
I'm not expecting miracles. Some distortion, artefacting, curves due to lens geometry is surely inevitable.
For the purposes of this question it must do true 3D manipulation, correcting foreshortening, not just warping the image based on moving the four corners of a rectangle.
Requirements:
- Cross platform
- Low level language such as C or C++
- Real 3D manipulation
Preferred but not required:
- Open source
- Free
- Fully automatic is great, but I'm expecting it requires some other parameters such as the coordinates of the four corners in the source image.