how to find the 3d location of a given pixel (fixed monocular camera)

asked 2014-05-28 14:46:28 -0500

basheersubei gravatar image

Given that I have the following:

  • known pixels from an undistorted image (taken by monocular camera)
  • fixed angle of inclination of camera
  • fixed height of camera and flat terrain (so the height from camera to ground is fixed)
  • intrinsic parameters of the camera (published over /camera_info), and also field-of-view angle

How can I find the 3-d (well, 2-d really since height is fixed) location (in the real world relative to the camera) of each pixel? i.e. what ROS packages/nodes should I use that have that functionality? I've been searching for a solution within ROS for weeks (and I'm surprised that no one has needed this before).

I attempted my own solution using some trigonometry, but it doesn't seem to work well (my equations must be off).

Is something like projectPixelTo3dRay in image_geometry what I'm looking for?

Perhaps I simply don't know WHAT to look for when I'm searching... Can anyone point me in the right direction? I can't seem to figure this out on my own...

edit retag flag offensive close merge delete

Comments

by the way, my implementation (the one that didn't work) converts the pixels to PointCloud2 data (if that helps)...

basheersubei gravatar image basheersubei  ( 2014-05-28 14:49:48 -0500 )edit