# Why the result of cv::affine3d(4x4) times cv::vec3d(3 dimensions vector) is still CV::Vec3d?

``````void function( ..... cv::Affine3d pose,....)
{
cv::Vec3d z_axis(0.0, 0.0, dev->len);
cv::Vec3d plane_vec = pose * z_axis;// the result of plane_vec is [-60.5844, 48.1445, -17.4011]
}
``````

In my opinion, pose is a 4x4 matrix which contains a 3x3 rotation matrix, a 3x1 translation matrix and a row containing 0001, and z_axis is an array containing 3 numbers.
why does this happen? it seems not obey the rule of matrix multiplication.

what makes you think, it’s a 4x4 matrix ?

also, how do you derive that pose ?
(admittedly, it would make a lot of sense to have a 4x4, homogeneous RT mat here, just this one does not seem like it)

Because I also get a translation matrix and rotation matrix from it, so I think it is a 4x4 matrix.
pose comes from another function

well it isnt.

you’d also need a homogeneous, 4d z_axis vec for the correct transformation, no ?

again, please show construction of the pose matrix

But could you tell me if pose is a 3x3 matrix, how does it contains these tow matrixs?
I mean if pose is a 4x4 matrix, then the left upper matrix is a 3x3 rotation and behind it is a 3x1 translation vector.
maybe pose is a 3x4 matrix?

any chance, it’s a homogeneous 2d transformation (R/T in a single 2d plane) ?
or 3x3 rotation only ?
otherwise, it cant be, simply.

again, no chance to know, without more details, sorry

OK, sorry to bother you so long.
I just print the translation, it is a 3 x1 vector [153.665, -1029.43, 36.6683]
And, could you tell me any information do you need to fix this problem.
the definition of pose in its class is cv::affine3d

OpenCV: cv::Affine3< T > Class Template Reference

that (default and Mat4 constructor) clearly states that it holds 4x4 data. I don’t see a reason to question that.

I don’t see where multiplication is defined on that thing. I don’t see superclasses.

however, `Vec` has operators… but docs don’t say what operation is performed by `operator*`

the operation M v should result in another vector that is either 4-element (generally) or 3-element (affine). did you expect something other than a vector?

ok, sorry, @crackwitz is right here:

(and it’s not a homogeneous transform, as i assumed)

2 Likes