File size: 1,670 Bytes
9a0dbee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash

# Define the scenes to process
SCENES=("campus_core")
# You can modify this list with your actual scene names

echo "Starting COLMAP processing for ${#SCENES[@]} scenes at $OVERALL_START_TIME"

# Process each scene
for SCENE_NAME in "${SCENES[@]}"; do

    # First run feature extraction for each scene
    echo "Running Feature Extractor..."
    colmap feature_extractor \
        --database_path ./global/database_core.db \
        --image_path ./images \
        --ImageReader.single_camera_per_folder 1 \
        --ImageReader.default_focal_length_factor 0.5 \
        --ImageReader.camera_model OPENCV \
        --image_list_path ./images/$SCENE_NAME/image_list.txt

    SCENE_START_TIME=$(date +"%H:%M:%S")
    echo "----------------------------------------"
    echo "Processing scene: $SCENE_NAME"
    echo "Scene start time: $SCENE_START_TIME"
    
    echo "Running feature matching for $SCENE_NAME..."
    colmap matches_importer \
        --database_path ./global/database_core.db \
        --match_list_path ./images/$SCENE_NAME/image_pairs_sequentially.txt \
        --image_list_path ./images/$SCENE_NAME/image_list.txt
    
    echo "Reconstructing 3D model for $SCENE_NAME..."
    colmap mapper \
        --database_path ./global/database_core.db \
        --image_path ./images \
        --output_path ./$SCENE_NAME \
        --image_list_path ./images/$SCENE_NAME/image_list.txt
    
    SCENE_END_TIME=$(date +"%H:%M:%S")
    echo "Scene $SCENE_NAME completed at: $SCENE_END_TIME"
    
done

OVERALL_END_TIME=$(date +"%H:%M:%S")
echo "----------------------------------------"
echo "All scenes processed. Completed at: $OVERALL_END_TIME"