视频在 B站
1.Data处理
这里以pytorch版MVSNet为例。
使用DTU training data(Fixed training cameras)
数据集共119个场景(Rectified文件夹中共119个文件,实际128个)
使用49个相机拍摄(Cameras/train文件夹中有49个记录参数的txt文件)
共7个仅光照不同的相同视角照片(Rectified/scan*_train文件夹中有49*7=343个文件)
通过train_dataset = MVSDataset()
将上述信息记录在self.metas
中,实际训练只使用79个场景,每个场景共7种光照信息和49组(每组10张)src视角,因次self.metas
长度为 49 × 7 × 79 = 27097 49\times7\times79=27097 49×7×79=27097。
通过enumerate(TrainImgLoader)
加载图像和参数信息。
论文中traing使用3视角,因此view_ids长度为3
- 加载图片信息,与其他任务(目标检测,跟踪)不同,这里只做了归一化没有水平翻转等操作.
- 提取内参外参,并获得投影矩阵 P = K [ R ∣ t ] P=K[R|t] P=K[R∣t].
- 根据ref_view提取深度值(根据最小深度、深度间隔、深度数量),掩码,和深度
2.特征提取
CNN 没什么好说的
维度由 [ b , 3 , 512 , 640 ] → [ b , 32 , 128 , 160 ] [b,3,512,640] \to [b,32,128,160] [b,3,512,640]→[b,32,128,160]
可微分的单应性,构建cost volume
All feature maps are warped into different frontoparallel planes of the reference camera to form N feature volumes V i {V_i} Vi
当 i = 1 i=1 i=1时为ref图像的 V 1 V_1 V1, 就是将ref特征复制 N = 192 N=192 N=192次。
当 i ≠ 1 i\neq1 i=1时为src图像的 V n V_n Vn,此时是已知 d , P 1 , P 2 d, P_1, P_2 d,P1,P2, 求 r e f f e a t u r e ref_{feature} reffeature