Then I divide the result by the third component w to get. x, image_points.y, 1]t which is related to the world coordinate (0, 0, 0). Now after calculating the inverse homography matrix, I multiplied it with. I am considering the the first world point as the origin (0, 0, 0) in the world axis and using known distance calculating the coordinates of the other four points. image_points contain the image coordinates of the four points and world_points contain the world coordinates of the four points. I have got the image coordinates of the four known world points and hard-coded it for simplification. Mat cameraMatrix, distCoeffs, rotationVector, rotationMatrix, translationVector, extrinsicMatrix, projectionMatrix, homographyMatrix, inverseHomographyMatrix įileStorage fs1( "intrinsics.yml ", FileStorage::READ) # include using namespace cv using namespace std After that I multiply the image points t with the inverse homography matrix to get t and the divide the entire vector by the scalar w to get which gives me the X and Y values of the world coordinates. Now, I find the inverse of the homography matrix which gives me the homography between the 3D world points to 2D image points. Since my z coordinate is zero, so I need to take off the third column from the projection matrix which gives the homography matrix for converting the 2D image points to 3D world points. Then, I need to use Rodrigues to transform the rotation vector into a rotation matrix and then concatenate it with the translation vector to get my extrinsic matrix and then multiply the extrinsic matrix with the camera matrix to get my projection matrix. So, I am new to computer vision and OpenCV, but in my knowledge, I just need 4 points on the image and need to know the world coordinates of those 4 points and use solvePNP in OpenCV to get the rotation and translation vectors (I already have the camera matrix and distortion coefficients). For that I have accomplished detection and tracking of vehicles and I need to find the 3-D world coordinates of the image points of the edges of the bounding boxes of the vehicles and then estimate the world coordinates of the edges of the cuboid and the project it back to the image to display it. I am currently working on my project which involves vehicle detection and tracking and estimating and optimizing a cuboid around the vehicle. I need to resolve my problem very urgently since my final year project deadline is approaching soon. Hi everyone, I understand that this forum is to report bugs and not to ask questions but I already posted about my problems in without any useful response.
Operating System / Platform => Windows 64 Bit.