简体   繁体   中英

How to use Camera Calibration parameters on OpenCV for Augmented Reality?

So far Ive succesfully calibrated a camera with Opencv by using the chessboard pattern in the tutorials, so I got the cameraMatrix, distCoefs, Rotation and Translation vectors.

Now Id like to display an image on top of my chessboard using the calibration parameters. How can I do that?

These are the steps Ive done so far:

1 - Get the chessboard corners

2 - projectPoints to get from world (640x480) to the warped frame seen during the calibration

3 - getPerspectiveTransform to get the transformation from world to warped image

4 - warpPerspective to get the image coordinates (the image Id like to display on top of the chessboard) to warp

5 - Create a mask on top of the chessboard

6 - flip the image Id like to display

7 - And finally copy the warped image to video frame on top of the area delimited by the mask.

Corners and mask are working fine. But Im not quite sure about the rest of the process.

Can anyone help me?

see this post i think my code will help you, i have an error but to understand how to make it i think the code will be good:

https://stackoverflow.com/questions/34785237/augmented-reality-projection-cube-error

good luck

PD : The code is in python !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM