First time here? Check out the FAQ!

Ask Your Question
1

Drawing 3D points on a distorted image

asked May 11 '17

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?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
0

answered May 11 '17

LBerger gravatar image

updated May 11 '17

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

Preview: (hide)

Question Tools

2 followers

Stats

Asked: May 11 '17

Seen: 1,921 times

Last updated: May 11 '17