简体   繁体   中英

OpenCV, projection on 3d surface

I'm currently working on a school project with an "autonomous" car, I need to project the image from my camera (which is situated on the car and slightly tilted), onto a 2d surface representing a road (i assume the road is perfectly flat), given the FOV, position and angle of my camera relative to the surface, how would I project it in OpenCV? What i need excatly is for the projection to be as if I had filmed the road from above at a 90° angle. Thanks in advance for help...

use opencv function to do it

C++: void reprojectImageTo3D(InputArray disparity, OutputArray _3dImage, InputArray Q, bool handleMissingValues=false, int ddepth=-1 )

The Q matrix is inverse of projection matrix K which contains camera center and fx fy

在此处输入图片说明

You can artificially create a disparity say a gradient map to represent the depth of the flat surface.

Then pass Q, disparty, and output3Dmat you want

The program will gives you what you want

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