变量:
-
all_wts:3D-3D,3D-2D和2D-2D权重 global_id:车辆总数 K_all:相机内参 angleMapdetectionsQ_dnos:原帧车辆回归框号 detectionsT_dnos:下一帧车辆回归框号 result_for_kitti_eval:预估结果 total_detecions总检测数 params_carCuboid(avgCar_Sz, sz_ub,sz_lb):车辆参数 sz_lb:车参上界 sz_ub:车参下界 avgCar_Sz[l, h, w]:车参:长,宽,高 params_2D3D = struct( K, n, h); K:相机内参 n[0,1,0]:道路平面 h:摄像机离地高度 detection = struct( 'dno', -1.0, ... 'bbox', zeros(4,1), ... 'sigma_2D', zeros(3,3), ... 'yaw', 0.0, ... 'bvolume', [], ... 'bvolume_proj', [], ... 'k', [], ... 'origin', zeros(3,1), ... 'start_frame', -1.0, ... 'end_frame', -1.0, ... 'sigma_3D', zeros(4,4) ... ); dno:车辆号 bbox:车辆检测区域 sigma_2D:2D激活函数 yaw:偏航角 bvolume:3D边界体积(bvolume),它是将偏航和LBH错误应用于平均汽车长方体边界后得到的点的凸包bvolume_projk:边界体积凸包 origin:车辆位置原点 start_frame:起始帧 end_frame:终止帧 sigma_3D:3D激活函数 num_matches:匹配数 pose:Monocular ORBSLAM获取参数[平移量,旋转量,偏航量] detections:车辆检测矩阵 feautes_2D2D:图像特征矩阵 start_fno:起始帧号 end_fno:终止帧号 scoreMatrices_for_seq(end_fno, 1)当前帧得分矩阵 first_time:是否是首帧 num_detectionsQ:当前帧检测出的车辆数 num_detectionsT:下一帧检测出的车辆数 detectionsQ:当前帧检测出的车辆位置回归框 detectionsT:下一帧检测出的车辆位置回归框 motion[1*4]:帧移动量
函数
-
getCanonicalCuboid(avg_sz):在图像二维图像上生成长方体 getOffsetBasedOnYaw([车宽,车高],yaw):计算要应用到X的偏移量,即回归框底线的中心,以实际到达车辆的中心。此偏移只能应用于Z方向。 generateScoreMatrices(detectionsQ, detectionsT):生成得分矩阵 get3D3DMatchScore(detectionsT{j}.bvolume, detectionsQ{i}.bvolume):3D车辆物体相交程度 get3D2DMatchScore(detectionsT{j}.bbox, detectionsQ{i}.bvolume_proj):3d投影相交程度 generate2D2DScoreMatrix(features_2D2D{i}, features_2D2D{i+1}):车辆回归框特征相似度矩阵
初始化权重,车参,结构体,导入pose矩阵,bounding box矩阵,feature矩阵,angle_map矩阵:
addpath('../third_party');
% 33 32 22 vp
all_wts = [0.6 0.4 0.2 0.0];
dcolors = distinguishable_colors(800);
for ww = 1:size(all_wts,1)
c33 = all_wts(ww,1);
c32 = all_wts(ww,2);
c22 = all_wts(ww,3);
cvp = all_wts(ww,4);
% 道路平面和相机高度
n = [0; 1; 0];
h = 1.72;
% 平均车参 avgCar_Sz = [4.3; 2; 2];
sz_ub = [34; 31.5; 31.5];
sz_lb = [-34; -31.5; -31.5];
K_all = load('../Data/calib/calib_all_test.txt');
angleMap = containers.Map([ 90:270 90:-1:0 360:-1:270], [0:-1:-180 0:90 90:180]);
hungarian_association = false;
detectionsQ_dnos = [];
detectionsT_dnos = [];
for s = [2]
seqNo = s;
result_for_kitti_eval = [];
total_detecions = 0;
%% SETUP PARAMETERS
image_path = sprintf('../Data/images/image_02/test/%04d',seqNo);
pose_path = sprintf('../