I have multiple camera in different points.

I have their position and rotation as $(x,y,z)$ , $(\alpha,\beta,\gamma)$ or $( roll, pitch, yaw)$ .

And I have output like this :

Feed from camera-1, I know length of yellow and green.

3d space calculation - 1

3d space calculation - 2

How can I calculate position of the object, in this case head in 3D space.


1 Answer 1


For each camera, you can compute the direction on which is detected the object. The position and orientation of the camera let you find the direction of the center of the image. Depending on camera aperture, each pixel of the image corresponds to a slightly different direction. I don't know which definition you use for your angle so I won't risk any expression of it but you should convert the angle to obtain a vector in cartesian coordinates.

So from a camera with position at $(x_c, y_c, z_c)$ and detecting the object in the pixel of direction defined by the unitary vector $(x_d, y_d, z_d)$, you know the object is along the direction:

($x_c + x_d \times d, y_c + y_d \times d, z_c + z_d \times d$) with $d$ being the distance camera-object.

Now if you have 2 cameras, you can look for the nearest points from each line to the other and take their center as position of the object (see skew lines).

  • $\begingroup$ each pixel of the image corresponds to a slightly different direction - i am not clear about it, can you explain a little more, that would be very much helpful .. $\endgroup$ Jun 20, 2019 at 14:26
  • 1
    $\begingroup$ Imagine you have a 2°x2° camera with 200x200 pixels. The corners pixels observe a direction doing $\pm 1^o$ of pitch and $\pm 1^o$ of yaw with respect to the center pixel. $\endgroup$
    – Optidad
    Jun 20, 2019 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.