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?
I have the following data:
My question is, how do I derive the object/world coordinate of my feature?
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.