nutonomy / nuscenes-devkit

The devkit of the nuScenes dataset.
https://www.nuScenes.org
Other
2.29k stars 629 forks source link

What is the intrinsic and extrinsic params? #1119

Open jeychandar opened 3 weeks ago

jeychandar commented 3 weeks ago

@HongyiSun For v1.0 mini dataset when I extracted there is a calibration json file and lot of intrinsic params. I could not find extrinsic params. For scene 61 what is the intrinsic and extrinsic params. Could you please provide?. Thanks in advance

whyekit-motional commented 3 days ago

@jeychandar you can get the intrinsic and extrinsic params for any sensor in a sample of a scene by doing something like:

from nuscenes.nuscenes import NuScenes

nusc = NuScenes(version='v1.0-mini', dataroot='/data/sets/nuscenes', verbose=False)

my_scene = nusc.scene[0]
my_sample_from_scene = nusc.get("sample", my_scene["first_sample_token"])
my_sd_of_sample_from_scene = nusc.get("sample_data", my_sample_from_scene["data"]["CAM_FRONT"])
my_cs_of_sd_of_sample_from_scene = nusc.get("calibrated_sensor", my_sd_of_sample_from_scene["calibrated_sensor_token"])
print(my_cs_of_sd_of_sample_from_scene)

The above code snippet gives:

{'token': '1d31c729b073425e8e0202c5c6e66ee1',
 'sensor_token': '725903f5b62f56118f4094b46a4470d8',
 'translation': [1.70079118954, 0.0159456324149, 1.51095763913],
 'rotation': [0.4998015430569128,
  -0.5030316162024876,
  0.4997798114386805,
  -0.49737083824542755],
 'camera_intrinsic': [[1266.417203046554, 0.0, 816.2670197447984],
  [0.0, 1266.417203046554, 491.50706579294757],
  [0.0, 0.0, 1.0]]}