Ask Your Question

trigal's profile - activity

2020-07-09 09:59:45 -0600 received badge  Self-Learner (source)
2020-07-06 17:36:47 -0600 commented answer projectpoints distortion

oki, done https://github.com/opencv/opencv/issues/17768

2020-07-06 13:04:20 -0600 commented answer Are Lens Distortion Coefficients inverted for projectPoints?

After thinking about this issue, i think they're not really "inverted" , it's a chicken-and-egg problem.. it really depe

2020-07-06 13:01:55 -0600 marked best answer projectpoints distortion

Hi everybody, I am opening a new question to add images and put together several other questions

To recap, I'm trying to project 3D points to an undistort image, in particular to the images from the KITTI raw dataset. For those who do not know it, for each of the sequences of the dataset, a calibration file is provided both in terms of intrinsic and extrinsic; the dataset contains both camera images and lidar 3D points; also, a tutorial for the projection of the 3D points is provided, but everything is proposed with the undistorted/rectified images that the dataset also provides. However, the intrinsic/extrinsic matrices are also provided so in general I should be able to project the 3D points directly on the image without having to either use their rectification or making any undistorsion of the raw image (raw means without processing in this case).

So let's start with their example, a projection of the points directly on the rectified image (please note, I'm saying rectified and not undistorted because the dataset has four cameras, so they provide the undistorted/rectified images).

image description

as you can see this image is pretty undistorted and the lidar points should be correctly aligned (using their demo toolkit here in matlab).

Next, using the info provided:

  • S_xx: 1x2 size of image xx before rectification
  • K_xx: 3x3 calibration matrix of camera xx before rectification
  • D_xx: 1x5 distortion vector of camera xx before rectification
  • R_xx: 3x3 rotation matrix of camera xx (extrinsic)
  • T_xx: 3x1 translation vector of camera xx (extrinsic)

together with the info about where the lidar-sensor is I can easily prepare an example to

  • read the lidar data.
  • rotate the points in the camera coordinate frame (it is the same thing that giving the projectpoints this transformation with the rvec/tvec, which i use as identities since the first camera is the origin of all the cordinate systems, but this is a detail)
  • project the points using projectPoints

Ok let's try to do this.... using

D_00 = np.array([ -3.745594e-01, 2.049385e-01, 1.110145e-03, 1.379375e-03, -7.084798e-02], dtype=np.float64)

image description

I hope you can see the image! there are points above the actual limit of the lidar points, as well some "noise" in between the other points (ok just to be fair, in the first image I didn't put all the points, but you should see a different "noise pattern" in this second image).

At the beginning I thought it was due to a stupid error in my code, parsing or whatsoever... but the I tried to do the same just using the undistorted image and thus setting the distortion coefficients to zero and... magic

D_00_zeros = np.array([ 0.0, 0.0, 0.0, 0.0, 0.0], dtype=np.float64)

image description

Can this be still my fault on parsing data? mmm ... so, I decided to create a "virtual plane" and move it through the ... (more)

2020-07-06 13:01:55 -0600 received badge  Scholar (source)
2020-07-06 13:01:29 -0600 answered a question projectpoints distortion

Ok let's answer this question. I've been digging into the opencv code, compiling all the necessary in debug mode and do

2020-07-02 13:37:40 -0600 commented answer Trying to re-distort image points using projectPoints

@tetragramm do you think this might be related to the problem I have here? https://answers.opencv.org/question/231939/pr

2020-07-02 01:28:56 -0600 received badge  Teacher (source)
2020-07-01 21:29:10 -0600 received badge  Necromancer (source)
2020-07-01 19:21:44 -0600 received badge  Organizer (source)
2020-07-01 19:20:55 -0600 received badge  Editor (source)
2020-07-01 19:20:55 -0600 edited question projectpoints distortion

projectpoints distortion Hi everybody, I am opening a new question to add images and put together several other question

2020-07-01 19:08:32 -0600 commented answer Are Lens Distortion Coefficients inverted for projectPoints?

i have just created an extended and more detailed version of the both question and "my answer" (that is not an answer...

2020-07-01 19:06:07 -0600 commented question cv::projectPoints giving bad results when undistorted 2d projections are far

I just created a new question with a more extended analysis of the issue https://answers.opencv.org/question/231939/proj

2020-07-01 19:05:12 -0600 asked a question projectpoints distortion

projectpoints distortion Hi everybody, I am opening a new question to add images and put together several other question

2020-07-01 17:55:29 -0600 answered a question Are Lens Distortion Coefficients inverted for projectPoints?

I'm answering instead of a comment just to upload two images with k1 > 0 with k1<0 Following the wiki the

2020-07-01 17:19:19 -0600 commented question cv::projectPoints giving bad results when undistorted 2d projections are far

I have a similar problem and I'm wondering if you can share the code to allow to predict wether the distortion goes ok.