Reputation: 53
So I already know the 3D camera position and the position and size of an object in the world frame, as well as the camera matrix and distortion coefficients from a previous camera calibration.
What I need to work out is the 2D image coordinates of the object. Let's just say the object is a sphere with world position objPos and radius objRad, so the image I want to find the coordinates for will be a circle of image position imgPos and radius imgRad.
How would I go about doing this?
Cheers
Upvotes: 0
Views: 734
Reputation: 1507
In OpenCV exists a function to project 3D coordinates on a (camera) image - projectPoints In my opinion you have all you need for calling this function. The arguments are:
If you have your extrinsic camera parameters in form of 4x4 matrix, you have to extract rvec and tvec from it (see here).
To come to your example case: I would generate the 3D coordinates of such a sphere with the corresponding radius. In a next step, I would project these 3D coordinate with above method.
Upvotes: 1