Ask Your Question
2

Convert 3D point to 2D image point

asked 2015-01-11 09:18:11 -0600

Hi, using OpenCV what is the fastest/easiest way to convert 3D points to 2D image points. I know that the points are expressed in x, y and z coords in milimeters, I have the camera parameters, the height of the camera (relative to the ground plane) is expressed also in milimeters. I need an easy way to convert these 3d points (x,y,z expressed in mm) to 2d points (expressed in pixels) using the data I have and obtain the Xi, Yi coords where the origin of the coordinate system in the top left corner of the image.

Best regards!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
5

answered 2015-01-11 10:04:11 -0600

You can use cv::projectpoints for this task:

http://docs.opencv.org/modules/calib3...

The simplest way to use it is by passing the points in the coordinate frame of the camera and setting rvec and tvec to (0,0,0). Then just pass the intrinsic calibration and distortion and you get the projected points.

edit flag offensive delete link more

Comments

Seems to be exactly what I need, I don't know how I missed it while searching! Thanks for the help!

razvan gravatar imagerazvan ( 2015-01-12 03:20:42 -0600 )edit

Is there a ways to project those 3d points to an image plane if there is NO camera matrix available?

nilsmelchert gravatar imagenilsmelchert ( 2018-05-11 08:13:49 -0600 )edit

To my knowledge, NO. Because projecting 3D points from world coordinate frame to image frame requires the availability of the CAMERA PARAMETERS. Else, what is the point of camera calibration?

MohammadKassemZein gravatar imageMohammadKassemZein ( 2019-01-29 05:56:15 -0600 )edit

why do we set rvec = tvec = (0,0,0) ?

Farid gravatar imageFarid ( 2019-07-30 08:37:10 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-01-11 09:18:11 -0600

Seen: 27,093 times

Last updated: Jan 11 '15