(points, mat, coeffs, p, r)
| 470 | |
| 471 | |
| 472 | def _undistort_points(points, mat, coeffs, p, r): |
| 473 | pts = points.reshape((-1, 3)) |
| 474 | pts_undist = cv2.undistortPoints( |
| 475 | src=pts[:, :2].astype(np.float32), |
| 476 | cameraMatrix=mat, |
| 477 | distCoeffs=coeffs, |
| 478 | P=p, |
| 479 | R=r, |
| 480 | ) |
| 481 | pts[:, :2] = pts_undist.squeeze() |
| 482 | return pts.reshape((points.shape[0], -1)) |
| 483 | |
| 484 | |
| 485 | def _undistort_views(df_view_pairs, stereo_params): |