Perspective correction
-
Hi,
Would it be possible to get a perspective image correction with current VA tools like in the image below:
Kind regards,
Lukas -
Hi Lukas,
In order to do perspective correction, you first have to calibrate the camera. In general it is not possible to just take a picture with any camera and change the perspective into something else without any knowledge about the position of the camera with respect to the object of interest.
One option is to use a QR code for the calibration. The method is described in this Visionappster cookbook. It would obviously be a bit challenging to glue a giant QR code on the wall of a 32-story building like in your example image so you'd have to tone down the scale of your scene a bitCheers,
-- Keijo -
Thanks Keijo for quick reply.
I'm just thinking if there is the way todo it wihtout QR/plate like selecting points on the image and it would do the rest. No precision is needed in this just to change the view.
I'm thinking if it would be a good idea to try integrating function with the help of C/Python api
cv2.getPerspectiveTransform(src, dst)
where in the
src
you would describe the source points and indst
destination points (new image size)
Kind regards,
Lukas -
Yes, you can certainly use getPerspectiveTransform and warpPerspective functions if you know where the wanted corners are in the input image (like the corners of the credit card in your example.) It will work using either C or Python API. It all boils down to the question on how you can find the four corner points for the transform.
Cheers,
-- Keijo