1

I have the following data:

  • camera matrix
  • 2d location of a feature in my image plane
  • depth map value associated with my feature

My question is, how do I derive the object/world coordinate of my feature?

MM.
  • 4,224
  • 5
  • 37
  • 74
  • look at the formula of projection (how image pixel location is computed from 3D position) and "invert" that process. – Micka Aug 05 '15 at 17:43
  • What is the formula you are referring to? – MM. Aug 05 '15 at 17:48
  • 2.2.1.0. C http://www.epixea.com/research/multi-view-coding-thesisse8.html – Micka Aug 05 '15 at 17:57
  • or just use my comments and answer from http://stackoverflow.com/questions/31265245/extracting-3d-coordinates-given-2d-image-points-depth-map-and-camera-calibratio/31266627#31266627 – Micka Aug 05 '15 at 18:25

1 Answers1

0

The camera matrix is:

[[fx 0  cx]
 [0  fy cy]
 [0  0  1 ]]

where fx and fy are the focal length in pixels. Since fx and fy are in pixels you can just use similar triangles to get the x and y coordinates:

x / z = (x_pixel - cx) / fx
y / z = (y_pixel - cy) / fy

or

x = (x_pixel - cx)/fx * z
y = (y_pixel - cy)/fy * z

You may have to multiply by -1 depending on how your coordinate systems are defined.

Chris K
  • 1,703
  • 1
  • 14
  • 26