I have a basic plane, with a camera NOT in front of it.
For projection mapping purpose, I have to make this deformed plane square back in my final render.
I tried to play with MapUv or Movie Plane deformation. But all I get is a more deformed output.
For now it’s a plane, but I intend to make animations of it, so I’d like to make this operation with the compositor if possible.
If you want to distort an image that you already have (a photo or render) then you could distort using the plane node (set it up in the tacker) or by using the corner pin distort node. But that requires you to input numbers for each corner.
Alternatively you could map the image onto a an image plane in 3D view and distort the mesh in edit mode.
Be warned that you wont be able to make a perspective render look like an orthogonal view as you have in the example above. There are simply to many vanishing points to correct.
One way to do this is to create a script that calculates the plane corner coordinates in screen space and creates keyframes for Cornerpin node in compositor.
Rendering out the UV coords of plane and then doing the distortion based on these is also an option. You could, I think, calculate the needed distortion based on the difference of UV image and screen space UV-s.