nuscenes数据读取和解析

1.nuScenes数据集标注格式的说明:

https://blog.youkuaiyun.com/qq_29679623/article/details/103698313?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-4&spm=1001.2101.3001.4242

https://www.freesion.com/article/5775777514/

2.根据json文件进行读取数据路径

https://blog.youkuaiyun.com/weixin_38362784/article/details/105841035

3.根据数据路径读取点云数据

https://blog.youkuaiyun.com/qq_37983000/article/details/109341670

4.官方api说明

https://scale.com/open-datasets/nuscenes/tutorial

坐标系说明:世界坐标系的轴的方向与IMU坐标系的轴的方向相同,所以如果需要将点云数据转换到世界坐标系,首先需要将点云数据转到IMU,然后再从IMU转到世界坐标系.

在 nusc.get('sample_data', sample_json['data'][ sensor]时,会返回对应的sensor_sample_data_json数据

结果如:

sample_data {
   "token":                   <str> -- Unique record identifier.
   "sample_token":            <str> -- Foreign key. Sample to which this sample_data is associated.
   "ego_pose_token":          <str> -- Foreign key.
   "calibrated_sensor_token": <str> -- Foreign key.
   "filename":                <str> -- Relative path to data-blob on disk.
   "fileformat":              <str> -- Data file format.
   "width":                   <int> -- If the sample data is an image, this is the image width in pixels.
   "height":                  <int> -- If the sample data is an image, this is the image height in pixels.
   "timestamp":               <int> -- Unix time stamp.
   "is_key_frame":            <bool> -- True if sample_data is part of key_frame, else False.
   "next":                    <str> -- Foreign key. Sample data from the same sensor that follows this in time. Empty if end of scene.
   "prev":                    <str> -- Foreign key. Sample data from the same sensor that precedes this in time. Empty if start of scene.
}

然后根据nusc.get('calibrated_sensor', sensor_sample_data_json['calibrated_sensor_token'])获取对应的calibrated_sensor_json文件,结果如

calibrated_sensor {
   "token":                   <str> -- Unique record identifier.
   "sensor_token":            <str> -- Foreign key pointing to the sensor type.
   "translation":             <float> [3] -- Coordinate system origin in meters: x, y, z.
   "rotation":                <float> [4] -- Coordinate system orientation as quaternion: w, x, y, z.
   "camera_intrinsic":        <float> [3, 3] -- Intrinsic camera calibration. Empty for sensors that are not cameras.
}

则此时的translation和rotation就是对应的平移,旋转关系,利用自带的源码geometry_utils中的transform_matrix,可以得到旋转平移矩阵,采用类里面的transform()方法实现对点云从雷达坐标系到IMU坐标系的转换,然后再利用ego_pose实现从IMU坐标系到世界坐标系的转换.

 

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值