Skip to content

Commit

Permalink
Expose velodyne-to-unrectified-cam0 transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
leeclemnet committed Oct 6, 2017
1 parent d8752b5 commit b313a09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions pykitti/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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))
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
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']
Expand Down

0 comments on commit b313a09

Please sign in to comment.