# Get 3d world coordinates given 2D pixel coordinates and a reference depth

**URL:** <https://forum.opencv.org/t/get-3d-world-coordinates-given-2d-pixel-coordinates-and-a-reference-depth/15568>\
**Category:** Python\
**Tags:** depth, 3dreconstruction\
**Created:** [November 18, 2023, 11:24am UTC](https://forum.opencv.org/t/get-3d-world-coordinates-given-2d-pixel-coordinates-and-a-reference-depth/15568 "2023-11-18T11:24:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mcolmc28](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/mcolmc28/32/9119_2.png) [@Mcolmc28](https://forum.opencv.org/u/Mcolmc28)\
**Post date:** [November 18, 2023, 11:24am UTC](https://forum.opencv.org/t/get-3d-world-coordinates-given-2d-pixel-coordinates-and-a-reference-depth/15568/1 "2023-11-18T11:24:01Z")

</div>

Hi there,  
I am new to computer vision and am working on a project where I need to estimate the depth of a bus user from a camera. I have been able to successfully detect user faces and have got their pixel coordinates. I now want to get the depth in 3d of the image point in world frame.

I have measurements for the bus environment and they are constant for all images. As shown in the attached image if I have a reference length L and given the walls are normal to the floor, can I estimate the depth of a pixel coordinate? If so what method would you suggest?

Thank you for your help!

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/c/c8b3d634bc9c58f7165914b903d3e7a1c9b7c5fc.jpeg)
