Commit 69e66d7b authored by Anatoly Baksheev's avatar Anatoly Baksheev

fixed little bug in makeCameraPose

parent f30f3b6c
...@@ -22,13 +22,11 @@ cv::Affine3f cv::viz::makeTransformToGlobal(const Vec3f& axis_x, const Vec3f& ax ...@@ -22,13 +22,11 @@ cv::Affine3f cv::viz::makeTransformToGlobal(const Vec3f& axis_x, const Vec3f& ax
cv::Affine3f cv::viz::makeCameraPose(const Vec3f& position, const Vec3f& focal_point, const Vec3f& y_dir) cv::Affine3f cv::viz::makeCameraPose(const Vec3f& position, const Vec3f& focal_point, const Vec3f& y_dir)
{ {
// Compute the transformation matrix for drawing the camera frame in a scene // Compute the transformation matrix for drawing the camera frame in a scene
Vec3f u,v,n; Vec3f n = normalize(focal_point - position);
n = normalize(focal_point - position); Vec3f u = normalize(y_dir.cross(n));
u = normalize(y_dir.cross(n)); Vec3f v = n.cross(u);
v = n.cross(u);
Matx44f pose_mat; Matx44f pose_mat = Matx44f::zeros();
pose_mat.zeros();
pose_mat(0,0) = u[0]; pose_mat(0,0) = u[0];
pose_mat(0,1) = u[1]; pose_mat(0,1) = u[1];
pose_mat(0,2) = u[2]; pose_mat(0,2) = u[2];
...@@ -86,4 +84,4 @@ namespace cv ...@@ -86,4 +84,4 @@ namespace cv
return reinterpret_cast<Vec3d*>(pointer); return reinterpret_cast<Vec3d*>(pointer);
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment