import random
def random_scale(image, calib, scale_range=(0.8, 1.2)):
scale = random.uniform(*scale_range)
width, height = image.size
image = image.resize((int(width * scale), int(height * scale)))
calib[:2, :] *= scale
return image, calib
def random_crop(image, left, w_out, upper, h_out, calib):
right = left + w_out
lower = upper + h_out
image = image.crop((left, upper, right, lower))
calib[0, 2] -= left # cx - du
calib[1, 2] -= upper # cy - dv
calib[0, 3] -= left * calib[2, 3] # tx - du * tz
calib[1, 3] -= upper * calib[2, 3] # ty - dv * tz
- Rotation_y(全局航向角
- 描述目标在现实世界中的朝向,不随目标的位置和采集车的位置变化而变化
- theta:目标方位角
- Alpha:目标观测角,Alpha = theta + Rotation_y
单目3D检测的难点:
上图来自论文:https://openreview.net/pdf?id=mPlm356yMIP,ICLR 2022
上图来自论文:3D Object Detection for Autonomous Driving: A Comprehensive Survey
- Depth-images based mono3D
- 融合RGB图像和深度图得到depth-aware特征
- 深度图由预训练的深度预测模型得到
- Pseudo-Lidar based mono3D
- 基于伪激光雷达的方法,首先讲深度图转为3D伪激光点云,再用基于激光雷达的3D检测算法进行检测
- Patch-based mono3D
- 基于patch的方法,将深度图转化为二维坐标图(2D coordinate map),然后在坐标图上用CNN进行检测
先验引导方法利用物体形状先验、几何先验、分割和时间约束来帮助检测3D物体
单目3D检测的先验信息:
3D检测用到的几何信息