title: Find 3D coordinate with respect to the camera using 2D image coordinates
body: <p>I need to calculate the X,Y coordinates in the world with respect to the camera using u,v coordinates in the 2D image. I am using an S7 edge camera to send a 720x480 video feed to MATLAB.</p>
  
  <p>What I know: Z i.e the depth of the object from the camera, size of the camera pixels (1.4um), focal length (4.2mm)</p>
  
  <p>Let's say the image point is at (u,v) = (400,400).</p>
  
  <p>My approach is as follows:</p>
  
  <ol>
  <li>Subtract the pixel value of center point (240,360) from the u,v pixel coordinates of the point in the image. This should give us the pixel coordinates with respect to the camera's optical axis (z axis). The origin is now at the center of the image. So new coordinates are: (160, -40)</li>
  <li>Multiply the new u,v pixel values with pixel size to obtain the distance of the point from the origin in physical units. Let's call it (x,y). We get (x,y) = (0.224,-0.056) in mm units.</li>
  <li>Use the formula X = xZ/f &amp; Y = yZ/f to calculate X,Y coordinates in the real world with respect to the camera's optical axis.</li>
  </ol>
  
  <p>Is my approach correct? </p>