From b313a094b18afd9fe20067ed3f68fcafcc325e65 Mon Sep 17 00:00:00 2001 From: Lee Clement Date: Fri, 6 Oct 2017 12:35:30 -0400 Subject: [PATCH] Expose velodyne-to-unrectified-cam0 transformation --- pykitti/raw.py | 7 +++---- setup.py | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pykitti/raw.py b/pykitti/raw.py index 695075c..9334a3f 100644 --- a/pykitti/raw.py +++ b/pykitti/raw.py @@ -130,7 +130,6 @@ def _load_calib_rigid(self, filename): filepath = os.path.join(self.calib_path, filename) data = utils.read_calib_file(filepath) return utils.transform_from_rot_trans(data['R'], data['T']) - def _load_calib_cam_to_cam(self, velo_to_cam_file, cam_to_cam_file): # We'll return the camera calibration as a dictionary @@ -139,6 +138,7 @@ def _load_calib_cam_to_cam(self, velo_to_cam_file, cam_to_cam_file): # Load the rigid transformation from velodyne coordinates # to unrectified cam0 coordinates T_cam0unrect_velo = self._load_calib_rigid(velo_to_cam_file) + data['T_cam0_velo_unrect'] = T_cam0unrect_velo # Load and parse the cam-to-cam calibration data cam_to_cam_filepath = os.path.join(self.calib_path, cam_to_cam_file) @@ -149,13 +149,12 @@ def _load_calib_cam_to_cam(self, velo_to_cam_file, cam_to_cam_file): P_rect_10 = np.reshape(filedata['P_rect_01'], (3, 4)) P_rect_20 = np.reshape(filedata['P_rect_02'], (3, 4)) P_rect_30 = np.reshape(filedata['P_rect_03'], (3, 4)) - + data['P_rect_00'] = P_rect_00 data['P_rect_10'] = P_rect_10 data['P_rect_20'] = P_rect_20 data['P_rect_30'] = P_rect_30 - # Create 4x4 matrices from the rectifying rotation matrices R_rect_00 = np.eye(4) R_rect_00[0:3, 0:3] = np.reshape(filedata['R_rect_00'], (3, 3)) @@ -165,7 +164,7 @@ def _load_calib_cam_to_cam(self, velo_to_cam_file, cam_to_cam_file): R_rect_20[0:3, 0:3] = np.reshape(filedata['R_rect_02'], (3, 3)) R_rect_30 = np.eye(4) R_rect_30[0:3, 0:3] = np.reshape(filedata['R_rect_03'], (3, 3)) - + data['R_rect_00'] = R_rect_00 data['R_rect_10'] = R_rect_10 data['R_rect_20'] = R_rect_20 diff --git a/setup.py b/setup.py index 5cc0b48..50e412c 100644 --- a/setup.py +++ b/setup.py @@ -2,12 +2,12 @@ setup( name='pykitti', - version='0.2.2', + version='0.2.3', description='A minimal set of tools for working with the KITTI dataset in Python', author='Lee Clement', author_email='lee.clement@robotics.utias.utoronto.ca', url='https://github.com/utiasSTARS/pykitti', - download_url='https://github.com/utiasSTARS/pykitti/tarball/0.2.2', + download_url='https://github.com/utiasSTARS/pykitti/tarball/0.2.3', license='MIT', packages=['pykitti'], install_requires=['numpy', 'matplotlib']