1

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...

Angramme
  • 164
  • 1
  • 10

1 Answers1

1

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

enter image description here

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

Dr Yuan Shenghai
  • 1,849
  • 1
  • 6
  • 19
  • Hehe, a bit late :) I did it kinda incorrectly using warpPerspective ( incorrect because further things are closer on y axis ) but it worked at the end :P, bit thanks a lot for your answer, I will remember it for the next time – Angramme May 26 '19 at 14:05