cdcseacave / openMVS

open Multi-View Stereo reconstruction library
http://cdcseacave.github.io
GNU Affero General Public License v3.0
3.39k stars 911 forks source link

Scalable pipeline produce bad point cloud #1174

Open rlamarche opened 1 month ago

rlamarche commented 1 month ago

Describe the bug I use the scalable pipeline to generate a point cloud using DensifyPointCloud command but I get a very bad point cloud. Using the standard pipeline with the same resolution level works perfectly.

To Reproduce Steps to reproduce the behavior:

I used COLMAP/GLOMAP to obtain a valid model, then aligned to a plan using colmap. I used exhaustive matching to be sure it was not an image matching problem. There is 480 images in the dataset. After undistorting, resolution is 2000x1333 (see colmap command below).

I'm using Ubuntu 22.04 with NVIDIA RTX 2070 Super and Driver Version: 535.183.06 CUDA Version: 12.2. I use a docker image based on colmap's one, where I added Glomap and OpenMVS. I can provide it if needed.

By the way, thank you for your program, it is really useful.

Here the full commands I ran after the glomap alignement :


mkdir glomap_exhaustive/1/aligned/dense
colmap image_undistorter \
    --image_path images \
    --input_path glomap_exhaustive/1/aligned/ \
    --output_path glomap_exhaustive/1/aligned/dense \
    --output_type COLMAP \
    --max_image_size 2000

mkdir glomap_exhaustive/1/aligned/dense/openmvs_multi/
InterfaceCOLMAP --input-file glomap_exhaustive/1/aligned/dense/ --output-file glomap_exhaustive/1/aligned/dense/openmvs_multi/scene.mvs

cd glomap_exhaustive/1/aligned/dense/openmvs_multi/

DensifyPointCloud --input-file scene.mvs --resolution-level 4 --fusion-mode 1
DensifyPointCloud --input-file scene.mvs --resolution-level 4 --sub-scene-area 1320000
for i in scene_*.mvs; do
    if [[ "$i" =~ ^scene_[0-9]+.mvs$ ]]; then
        echo $i
        j="$(echo $i|sed -r 's/^(scene_[0-9]+).mvs$/\1_dense.mvs/')"
        echo $j
        if [ ! -f "$j" ]; then
            echo "File not found: $j"
            echo "DensifyPointCloud $i"
            DensifyPointCloud $i \
                --geometric-iters 0 \
                --postprocess-dmaps 0 \
                --resolution-level 4 \
                --number-views-fuse 2
        fi
    fi
done

The point cloud obtained using each chunks is

scalable_pipeline_pointcloud

Even chunks one by one looks really bad.

  1. See error

Expected behavior The different chunks of the point cloud should be like the one obtained without using the scalable pipeline.

Screenshots Valid point cloud obtained with only the command :

DensifyPointCloud --input-file scene.mvs --resolution-level 4

valid_pointcloud

Desktop (please complete the following information):

Additional context I already succeeded previously to use scalable pipeline on a large dataset (> 2000 images) of underwater images taken by an underwater drone (very bad quality).

The dataset used here is taken using an aerial drone using a sony Full Frame Camera (60 MP) down sized to 2000x1333 when undistorting using Colmap.

rlamarche commented 1 month ago

11 chunks were created :

-rw-r--rw- 1 root root  24M Sep 30 09:50 scene.mvs
-rw-r--rw- 1 root root 345K Sep 30 09:56 scene_0000.mvs
-rw-r--rw- 1 root root 345K Sep 30 09:57 scene_0000_dense.mvs
-rw-r--rw- 1 root root 4.5M Sep 30 09:56 scene_0001.mvs
-rw-r--rw- 1 root root 4.6M Sep 30 09:58 scene_0001_dense.mvs
-rw----rw- 1 root root 142M Sep 30 09:58 scene_0001_dense.ply
-rw-r--rw- 1 root root 3.7M Sep 30 09:56 scene_0002.mvs
-rw-r--rw- 1 root root 3.8M Sep 30 09:58 scene_0002_dense.mvs
-rw----rw- 1 root root 265M Sep 30 09:58 scene_0002_dense.ply
-rw-r--rw- 1 root root 671K Sep 30 09:56 scene_0003.mvs
-rw-r--rw- 1 root root 677K Sep 30 09:58 scene_0003_dense.mvs
-rw----rw- 1 root root  22M Sep 30 09:58 scene_0003_dense.ply
-rw-r--rw- 1 root root 280K Sep 30 09:56 scene_0004.mvs
-rw-r--rw- 1 root root 283K Sep 30 09:58 scene_0004_dense.mvs
-rw----rw- 1 root root  33M Sep 30 09:58 scene_0004_dense.ply
-rw-r--rw- 1 root root 2.0M Sep 30 09:56 scene_0005.mvs
-rw-r--rw- 1 root root 4.3M Sep 30 09:58 scene_0005_dense.mvs
-rw----rw- 1 root root 105M Sep 30 09:58 scene_0005_dense.ply
-rw-r--rw- 1 root root 5.9M Sep 30 09:56 scene_0006.mvs
-rw-r--rw- 1 root root 6.1M Sep 30 09:59 scene_0006_dense.mvs
-rw----rw- 1 root root 270M Sep 30 09:59 scene_0006_dense.ply
-rw-r--rw- 1 root root 587K Sep 30 09:56 scene_0007.mvs
-rw-r--rw- 1 root root 589K Sep 30 09:59 scene_0007_dense.mvs
-rw----rw- 1 root root  25M Sep 30 09:59 scene_0007_dense.ply
-rw-r--rw- 1 root root 7.6M Sep 30 09:56 scene_0008.mvs
-rw-r--rw- 1 root root 7.7M Sep 30 09:59 scene_0008_dense.mvs
-rw----rw- 1 root root 295M Sep 30 09:59 scene_0008_dense.ply
-rw-r--rw- 1 root root 5.0M Sep 30 09:56 scene_0009.mvs
-rw-r--rw- 1 root root 5.1M Sep 30 10:00 scene_0009_dense.mvs
-rw----rw- 1 root root 171M Sep 30 10:00 scene_0009_dense.ply
-rw-r--rw- 1 root root 5.3M Sep 30 09:56 scene_0010.mvs
-rw-r--rw- 1 root root 5.5M Sep 30 10:00 scene_0010_dense.mvs
-rw----rw- 1 root root 449M Sep 30 10:00 scene_0010_dense.ply
-rw-r--rw- 1 root root  25M Sep 30 09:55 scene_dense.mvs
-rw----rw- 1 root root  14M Sep 30 09:55 scene_dense.ply
-rw----rw- 1 root root 751K Sep 30 09:58 tower.ply
rlamarche commented 1 month ago

The logs

DensifyPointCloud-2409301000148B487F.log DensifyPointCloud-2409300959528B4846.log DensifyPointCloud-2409300959228B480D.log DensifyPointCloud-2409300959198B47D6.log DensifyPointCloud-2409300958508B479D.log DensifyPointCloud-2409300958368B4764.log DensifyPointCloud-2409300958328B472D.log DensifyPointCloud-2409300958278B46F6.log DensifyPointCloud-2409300958018B46BF.log DensifyPointCloud-2409300957388B4686.log DensifyPointCloud-2409300957378B464F.log DensifyPointCloud-2409300956028B4646.log DensifyPointCloud-2409300950248B45F1.log

rlamarche commented 1 month ago

Note that I made different tests using resolution-level = 2 and increasing / decreasing the number of sub scene area (until 2 sub-scene) and always got the same behaviour.

rlamarche commented 1 month ago

Screenshot of the biggest chunk (file size) :

chunk

rlamarche commented 1 month ago

Side view using orthographic projection of the point cloud generated without using subscene parameters, where you can see some noise under : side