tvec and coordinate systems q

asked 2020-12-07 12:20:58 -0600

coldheat gravatar image

The output of solvePnp tvec and rvec: is tvec in world coordinates? I am guessing it is b/c the chessboard calibration is in mm. Second, what is tvec measuring from-to?

edit retag flag offensive close merge delete


AIUI, when you transform from frame A to frame B, the tvec represents the "position" of A in B's frame. conceptually, coordinates you have in A are moved into B by adding the tvec. you can check what I'm saying by pointing the image center at one of the corners of the board, and seeing if the tvec is (~0, ~0, +distance) for one of them (the origin of the board). if the tvec were relative to A, and you weren't right on an axis of A, you'd see that in the values. what you see should confirm that the tvec is in B (destination frame). the full pose matrix does a rotation from A into A's orientation in B, and then translates into A's position in B.

crackwitz gravatar imagecrackwitz ( 2020-12-07 17:14:02 -0600 )edit

Most of that makes sense to me. Though I'm unclear on the nature of A & B. Do the frames A and B represent different coordinate systems image plane to world coordinates? I'm sorry that's such a basic question. I do understand testing the tvec and passing the information forward. I've successfully matched the image points with the model points, computed the pose(rt) and the projective transformation K(rt).

coldheat gravatar imagecoldheat ( 2020-12-08 11:54:32 -0600 )edit

when I said "frame", I mean an abstract thing: a coordinate frame, coordinate axis, frame of reference, a "basis" to use a linear algebra term. in this situation your "space" is three-dimensional. -- a point in a 3-dimensional space can be represented by a 3-vector, which describes the point as a linear combination of this vector's elements with the basis vectors (which represent a unit length each). -- we don't know "universally" how the frames are placed "in space". we know how they are positioned relative to each other from their "basis transformation" matrices, which are 4x4 (3 dims + another "projective" one to enable translation), and describe the transformation such that a point, relative/native to one frame, is transformed to be relative to another frame.

crackwitz gravatar imagecrackwitz ( 2020-12-08 15:51:15 -0600 )edit

SolvePnp gives me a tvec that measures accurately the distance to the plane in mm.

I know the math behind plane-ray intersection (huge amount of info on the web) but I am having trouble with the setup of the ray, and how tvec integrates with it. If I can correctly get the ray projected from the camera I'm home free. Prototype: r0 + r1*t for ray.

coldheat gravatar imagecoldheat ( 2020-12-09 11:37:29 -0600 )edit

what ray are you talking about? I don't follow.

crackwitz gravatar imagecrackwitz ( 2020-12-09 14:58:46 -0600 )edit

I'm sorry. I want to create a ray from camera center to plane model. I was wondering whether tvec would have any role in that.

coldheat gravatar imagecoldheat ( 2020-12-10 10:24:37 -0600 )edit

tvec is precisely that vector in the camera frame that points to the plane frame's origin

crackwitz gravatar imagecrackwitz ( 2020-12-10 13:12:17 -0600 )edit