Ask Your Question
1

Drawing 3D points on a distorted image

asked 2017-05-11 09:32:16 -0600

kam3k gravatar image

I have the intrinsic parameters of my camera (camera matrix and distortion parameters). I also have a 3D point in the camera coordinate frame. I'd like to project that point onto the image, and show the result.

The distortion parameters seemed to be used in two places:

  1. When calling undistort(), which provides me with an undistorted image;
  2. When calling projectPoints(), which transforms my 3D point into a 2D point on the image.

I then add a cv::circle to the image with the resulting 2D point and imshow() the resulting image.

My question is this: Calling undistort() results in a cropped image, so do the resulting points from projectPoints() give pixel coordinates in the original distorted image, or are the pixel coordinates in the undistorted image? Put differently, should I call undistort() before drawing the point on my image if I want the point to be drawn in the right spot? Does undistorting the image before drawing on it compensate for the distortion twice?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-05-11 11:41:27 -0600

LBerger gravatar image

updated 2017-05-11 11:43:50 -0600

undistort doc is hereThe function computes projections of 3D points to the image plane given intrinsic and extrinsic camera parameters) If you give 3d points and intrinsic parameters and distortion coefficients you don't need to undistort image.

If you don't give distortion coefficients then points are in undistort image.

In both case you have to give camera pose relative to world coordinates

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-05-11 09:32:16 -0600

Seen: 1,887 times

Last updated: May 11 '17