纹理映射部分主要编译运行了Github上两个以C++为主的源代码:G2LTex和mve两部分。
G2LTex
G2LTex源码链接:https://github.com/fdp0525/G2LTex
项目的输入数据集目录结构:
|——apt0
|——apt0
| |——color_00.jpg(彩色图像序列)
| |——…………
| |——color_**.jpg
| |
| |——color_01.png(深度图像序列)
| |——…………
| |——color_**.png
| |
| |——color_01.cam(相机位姿)
| |——……………
| |——color_**.cam
|
|——data.ply//(要进行重建对象的的格网模型)
进入G2LTex主目录,运行:
./bin/G2LTex Data/apt0/apt0 Data/apto/apt0.ply
//生成的文件目录后续补充(Data/apt0目录下生成result.obj
等文件。)
运行时遇到的错误:Could not load image header of Data/apt0/apt0/color_00.jpg
tok:Data/apt0/apt0
tok:Data/apt0/apt0.ply
PLY Loader: comment VCGLIB generated
Reading PLY: 347095 verts... 665321 faces... done.
Removed 150 redundant faces.
Generating texture views:
-----------tok ext size:12
Failed to open settings file at:
depth fx:0 fy:0 cx:0 cy:0 width:0 height:0
RGB fx:0 fy:0 cx:0 cy:0 width:0 height:0
Global depth:0 RGB:0
Local RGB:0 edge:0 Reg:0
Global Iterations:0 Local Iterations:0
Could not load image header of Data/apt0/apt0/color_00.jpg
Cannot determine image format
在Github上有人问到了相类似的问题,但目前还没有得到解答,也没有详细阅读这个项目下的源码,只能等待作者及时有效的回复。
Github上问题链接地址:https://github.com/fdp0525/G2LTex/issues/18
具体纹理映射的效果可以通过项目的result
目录查看所给数据集的重建效果。
MVE
mve源码链接:https://github.com/simonfuhrmann/mve
这个项目结构比较复杂功能也比较强大,其中可以具体查看他们的首页Multi-View Environment,他们也提供了数据集和相应的论文。
编译运行mvs的示例可以查看TexRecon – 3D Reconstruction Texturing
我编译测试mve的Der Hass数据集的过程可以参考下面描述:
imdir=<directory where you have your images> //数据集目录
codedir=<directory where you want to do the compilation> //编译mve的位置
cd $codedir
# Download and compile MVE 下载编译MVE
cd $codedir
git clone https://github.com/simonfuhrmann/mve.git
//可以现在Github上进行下载
make -j8 -C mve
# Compile UMVE
cd mve/apps/umve && qmake && make
# Download and compile texrecon
cd $codedir
git clone https://github.com/nmoehrle/mvs-texturing.git texrecon
cd texrecon && mkdir build && cd build
cmake ..
make -j8
# Image import & bundling (images --> camera parameters)
cd $imdir //进入到数据集目录
$codedir/mve/apps/makescene/makescene -i . scene
$codedir/mve/apps/sfmrecon/sfmrecon scene
# Multi-view stereo reconstruction (images + camera parameters --> depth maps)
$codedir/mve/apps/dmrecon/dmrecon -s3 scene
#-s3 downscales the images three times 缩小图像三次
# Surface reconstruction (depth maps + camera parameters --> 3D model)
$codedir/mve/apps/scene2pset/scene2pset -F3 scene point-set.ply
$codedir/mve/apps/fssrecon/fssrecon point-set.ply surface.ply
$codedir/mve/apps/meshclean/meshclean -t10 -c10000 surface.ply surface-clean.ply
# Texturing (3D model + images + camera parameters --> textured 3D model)
$codedir/texrecon/build/apps/texrecon/texrecon scene::undistorted surface-clean.ply textured
# Inspect results
$codedir/mve/apps/umve textured.obj
mve的输入数据集的结构:
mve源码数据输入
|——data-mvs
| |——bundle.nvm //具体内容含义还没分析清楚
| |——IMG_0001.jpg //彩色图像序列
| |——IMG_0002.jpg
| |——………………
| |——IMG_***.jpg
得到mve重建后的模型textured.obj
重建后的模型非常清晰。
——————————————————————
对上面两个源码又有了一定的认识和理解。其中MVE是一个完整的单目三维重建项目。openMVG和openMVS这两个开源项目也提供了一个完整的单目三维重建流程。这两个项目对单个物体的最终重建效果都非常清晰。也相互测试了各自的官方数据集,效果分别如下图,但是用openMVS对MVE数据集Derhass测试时,ubuntu18.04下,报出killed,没有得到最终的重建结果。
思路还是比较混乱,可能后期清晰一点之后再回来补充。
我们目前需要和寻找的理想重建方案是一种基于采集到的深度图像进行室内实时重建的方案。目前接触测试的几个开源的rgbdslam(ORB_SLAM2为主),在测试自己的数据集时特征提取上出了很大的问题,对于官方数据集效果确实非常好。确实还有很长的路要走,还是继续了解一些三维重建的方案,先有一定的入门了解。