0

I try to find objects in 3D point cloud and project those 3D point cloud points on 2D image. I have camera matrix, 2D points for detected objects' coordinates and 3D points for object in the point cloud. With these matrices, I have found rotation matrix (3x4) but I have no idea how to project this rotation matrix on an image. Any help will be appreciated.

morgan
  • 1
  • 3

1 Answers1

1

You can use the function cv2.projectPoints() as follows:

cv2.projectPoints(objectPoints, rvec, tvec, cameraMatrix, distCoeffs[, imagePoints[, jacobian[, aspectRatio]]]) → imagePoints, jacobian

objectPoints is the 3xN/Nx3 flattened vector of the 3D object coordinates rvec is the Rotation vector. You can convert the Rotation matrix to the a Rotation vecotr using the Rodrigues() function.

The OpenCV documentation of this function is here. Once you get the 2D projected points of the respective 3D coordinates, you can compare it with the original 2D coordinates of the object, may be by overlaying it in two different color channels and visualizing it. Hope this helps :)

Lalith Nag
  • 36
  • 2