camera frame world coordinates relative to fiducial

P3d0r

I am trying to determine camera position in world coordinates, relative to a fiducial position based on fiducial marker found in a scene.

My methodology for determining the viewMatrix is described here: Determine camera pose?

I have the rotation and translation, [R|t], from the trained marker to the scene image. Given camera calibration training, and thus the camera intrinsic results, I should be able to discern the cameras position in world coordinates based on the perspective & orientation of the marker found in the scene image.

Can anybody direct me to a discussion or example similar to this? I'd like to know my cameras position based on the fiducial marker, and I'm sure that something similar to this has been done before, I'm just not searching the correct keywords.

Appreciate your guidance.

Kornel

What do you mean under world coordinates? If you mean object coordinates then you should use the inverse transformation of solvepnp's result. Given a view matrix [R|t], we have that inv([R|t]) = [R'|-R'*t], where R' is the transpose of R. In OpenCV:

cv::Mat rvec, tvec;
cv::solvePnP(objectPoints, imagePoints, intrinsics, distortion, rvec, tvec);

cv::Mat R;
cv::Rodrigues(rvec, rotation);

R = R.t();          // inverse rotation
tvec = -R * tvec;   // translation of inverse

// camPose is a 4x4 matrix with the pose of the camera in the object frame
cv::Mat camPose = cv::Mat::eye(4, 4, R.type());
R.copyTo(camPose.rowRange(0, 3).colRange(0, 3)); // copies R into camPose
tvec.copyTo(camPose.rowRange(0, 3).colRange(3, 4)); // copies tvec into camPose

Update #1:

Result of solvePnP

solvePnP estimates the object pose given a set of object points (model coordinates), their corresponding image projections (image coordinates), as well as the camera matrix and the distortion coefficients.

The object pose is given by two vectors, rvec and tvec. rvec is a compact representation of a rotation matrix for the pattern view seen on the image. That is, rvec together with the corresponding tvec brings the fiducial pattern from the model coordinate space (in which object points are specified) to the camera coordinate space.

That is, we are in the camera coordinate space, it moves with the camera, and the camera is always at the origin. The camera axes have the same directions as image axes, so

  • x-axis is pointing in the right side from the camera,
  • y-axis is pointing down,
  • and z-axis is pointing to the direction of camera view

The same would apply to the model coordinate space, so if you specified the origin in upper right corner of the fiducial pattern, then

  • x-axis is pointing to the right (e.g. along the longer side of your pattern),
  • y-axis is pointing to the other side (e.g. along the shorter one),
  • and z-axis is pointing to the ground.

You can specify the world origin as the first point of the object points that is the first object is set to (0, 0, 0) and all other points have z=0 (in case of planar patterns). Then tvec (combined rvec) points to the origin of the world coordinate space in which you placed the fiducial pattern. solvePnP's output has the same units as the object points.

Take a look at to the following: 6dof positional tracking. I think this is very similar as you need.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Calculating world coordinates from camera coordinates

From Dev

How to Convert World Coordinates to Camera Image Coordinates?

From Dev

How to get the pixel indices from the world coordinates with a calibrated camera in matlab

From Dev

Three.js world coordinates from mouse position with Orthographic camera

From Dev

How to listen to camera's world position in A-Frame?

From Dev

Argon.js/A-Frame: local coordinates from getEntityPose() are not relative to refereceFrame

From Dev

Relative coordinates in DrawingBrush

From Dev

Relative coordinates in DrawingBrush

From Dev

Camera Relative Movement

From Dev

Calculate World Coordinates from Normalized Device Coordinates

From Dev

Converting Camera Coordinates to Custom View Coordinates

From Dev

GetWindowRect coordinates not screen-relative

From Dev

how to make coordinates relative to a canvas

From Dev

Relative cardinal direction of two coordinates

From Dev

Python, move turtle to relative coordinates

From Dev

Relative layout changes the coordinates of imageview

From Dev

Facial detection coordinates using a camera

From Dev

Libgdx Coordinates after rotateAround camera

From Dev

Rolling a sphere relative to Camera Rotation

From Dev

How to know coordinates of java frame?

From Dev

Game Dev - Working with Screen Coordinates vs World Coordinates

From Dev

Converting 2D mouse coordinates to world XZ coordinates in ThreeJS

From Dev

How to get world coordinates from screen coordinates in Vispy

From Dev

How to get the world coordinates of a point in a child actor?

From Dev

Finding World Space Coordinates of a Unity UI Element

From Dev

How to get game coordinates in the entire world?

From Dev

How to get the world coordinates of a point in a child actor?

From Dev

Mouse input isn't correct to world coordinates

From Dev

Determine screen coordinates from point in DirectX world

Related Related

  1. 1

    Calculating world coordinates from camera coordinates

  2. 2

    How to Convert World Coordinates to Camera Image Coordinates?

  3. 3

    How to get the pixel indices from the world coordinates with a calibrated camera in matlab

  4. 4

    Three.js world coordinates from mouse position with Orthographic camera

  5. 5

    How to listen to camera's world position in A-Frame?

  6. 6

    Argon.js/A-Frame: local coordinates from getEntityPose() are not relative to refereceFrame

  7. 7

    Relative coordinates in DrawingBrush

  8. 8

    Relative coordinates in DrawingBrush

  9. 9

    Camera Relative Movement

  10. 10

    Calculate World Coordinates from Normalized Device Coordinates

  11. 11

    Converting Camera Coordinates to Custom View Coordinates

  12. 12

    GetWindowRect coordinates not screen-relative

  13. 13

    how to make coordinates relative to a canvas

  14. 14

    Relative cardinal direction of two coordinates

  15. 15

    Python, move turtle to relative coordinates

  16. 16

    Relative layout changes the coordinates of imageview

  17. 17

    Facial detection coordinates using a camera

  18. 18

    Libgdx Coordinates after rotateAround camera

  19. 19

    Rolling a sphere relative to Camera Rotation

  20. 20

    How to know coordinates of java frame?

  21. 21

    Game Dev - Working with Screen Coordinates vs World Coordinates

  22. 22

    Converting 2D mouse coordinates to world XZ coordinates in ThreeJS

  23. 23

    How to get world coordinates from screen coordinates in Vispy

  24. 24

    How to get the world coordinates of a point in a child actor?

  25. 25

    Finding World Space Coordinates of a Unity UI Element

  26. 26

    How to get game coordinates in the entire world?

  27. 27

    How to get the world coordinates of a point in a child actor?

  28. 28

    Mouse input isn't correct to world coordinates

  29. 29

    Determine screen coordinates from point in DirectX world

HotTag

Archive