这个dockerfile built的时候,有几个地方需要注意一下: 1,每一个RUN命令都是一层,执行‘docker-compose built'的时候,从修改的地方开始,之后每一行代码都会重新执行,而之前的会使用缓存。所以要把那些稳定的,耗时长的RUN命令放到前面。因为并不是built一次就成功了,重复下载会浪费大量的时间。。。
2,有很多种方式获得可执行程序? 源码编译(这个一般从github上面) docker镜像(通过docker命令获取)。现在的经验是简单的(依赖少的)建议通过docker镜像(如果有点话),复杂的尽量还是通过源码编译的方式,因为有大量的依赖,使用docker镜像无法正常运行
This repository contains a Docker-based 3D reconstruction pipeline using COLMAP and OpenMVS.
- Clone this repository:
git clone <repository-url>
cd <repository-directory>- Build the Docker container:
docker-compose build- Start the Docker container:
docker-compose up -dTo perform 3D reconstruction from images:
-
Place your images in the
images/directory. -
Run the reconstruction script inside the Docker container:
docker-compose exec mvs bash -c "cd /workspace && ./scripts/reconstruct.sh"- Check the results:
docker-compose exec mvs bash -c "cd /workspace && ./scripts/check_results.sh"The reconstruction pipeline produces the following outputs:
-
Sparse Reconstruction (COLMAP):
output/colmap/sparse/- Sparse point cloud and camera poses
-
Dense Reconstruction (COLMAP):
output/colmap/dense/- Dense point cloudoutput/colmap/dense/fused.ply- Fused point cloud
-
Mesh Reconstruction (OpenMVS):
output/openmvs/scene.mvs- Initial MVS sceneoutput/openmvs/scene_dense.mvs- Dense point cloudoutput/openmvs/scene_mesh.mvs- Reconstructed meshoutput/openmvs/scene_mesh_refined.mvs- Refined meshoutput/openmvs/scene_mesh_textured.obj- Textured mesh (final output)
- COLMAP Feature Extraction: Extract features from images
- COLMAP Feature Matching: Match features between images
- COLMAP Sparse Reconstruction: Create sparse point cloud and estimate camera poses
- COLMAP Dense Reconstruction: Create dense point cloud
- OpenMVS Interface: Convert COLMAP output to OpenMVS format
- OpenMVS Dense Point Cloud: Densify the point cloud
- OpenMVS Mesh Reconstruction: Create a mesh from the point cloud
- OpenMVS Mesh Refinement: Refine the mesh
- OpenMVS Mesh Texturing: Add texture to the mesh
The final textured mesh can be viewed with any 3D viewer that supports OBJ files, such as:
You can customize the reconstruction parameters by editing the scripts/reconstruct.sh file. The most common parameters to adjust are:
- Resolution levels
- Mesh refinement parameters
- Texture quality
- Docker
- Docker Compose
- 构建Docker镜像:
docker-compose build- 启动容器:
docker-compose up -d- 进入容器:
docker-compose exec mvs bash在容器内运行以下命令来验证安装:
# 验证COLMAP安装
colmap --version
# 验证OpenMVS安装
DensifyPointCloud --version- 将您的图像数据放在项目目录中
- 进入容器后,您可以使用COLMAP进行特征提取和SfM重建
- 使用OpenMVS进行密集重建和网格生成
images/: 存放输入图像output/: 存放重建结果scripts/: 存放处理脚本