first auxiliary files
Browse files- glomap_mapper.sh +56 -0
- glomap_reconstruction.sh +67 -0
- vslamlab_glomap_settings.yaml +78 -0
glomap_mapper.sh
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
echo "Executing glomapMapper.sh ..."
|
| 3 |
+
|
| 4 |
+
sequence_path="$1"
|
| 5 |
+
exp_folder="$2"
|
| 6 |
+
exp_id="$3"
|
| 7 |
+
settings_yaml="$4"
|
| 8 |
+
calibration_yaml="$5"
|
| 9 |
+
rgb_csv="$6"
|
| 10 |
+
camera_name="$7"
|
| 11 |
+
|
| 12 |
+
exp_folder_colmap="${exp_folder}/colmap_${exp_id}"
|
| 13 |
+
rgb_dir="${camera_name}"
|
| 14 |
+
rgb_path="${sequence_path}/${rgb_dir}"
|
| 15 |
+
|
| 16 |
+
read -r calibration_model more_ <<< $(python3 Baselines/colmap/get_calibration.py "$calibration_yaml" "$camera_name")
|
| 17 |
+
echo " camera model : $calibration_model"
|
| 18 |
+
optimize_intrinsics="0"
|
| 19 |
+
skip_view_graph_calibration="1"
|
| 20 |
+
if [ "${calibration_model}" == "unknown" ]
|
| 21 |
+
then
|
| 22 |
+
optimize_intrinsics="1"
|
| 23 |
+
skip_view_graph_calibration="0"
|
| 24 |
+
fi
|
| 25 |
+
|
| 26 |
+
echo " glomap mapper ..."
|
| 27 |
+
database="${exp_folder_colmap}/colmap_database.db"
|
| 28 |
+
|
| 29 |
+
glomap mapper \
|
| 30 |
+
--database_path "${database}" \
|
| 31 |
+
--image_path "${rgb_path}" \
|
| 32 |
+
--output_path "${exp_folder_colmap}" \
|
| 33 |
+
--skip_view_graph_calibration "${skip_view_graph_calibration}" \
|
| 34 |
+
--BundleAdjustment.optimize_intrinsics "${BundleAdjustment_optimize_intrinsics}"
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
# colmap image_undistorter \
|
| 38 |
+
# --image_path "${rgb_path}" \
|
| 39 |
+
# --input_path "${exp_folder_colmap}/0" \
|
| 40 |
+
# --output_path "${exp_folder_colmap}" \
|
| 41 |
+
# --output_type COLMAP \
|
| 42 |
+
# --max_image_size 2000
|
| 43 |
+
|
| 44 |
+
# colmap patch_match_stereo \
|
| 45 |
+
# --workspace_path "${exp_folder_colmap}" \
|
| 46 |
+
# --workspace_format COLMAP \
|
| 47 |
+
# --PatchMatchStereo.cache_size 64 \
|
| 48 |
+
# --PatchMatchStereo.filter true \
|
| 49 |
+
# --PatchMatchStereo.window_step 2 \
|
| 50 |
+
# --PatchMatchStereo.geom_consistency true
|
| 51 |
+
|
| 52 |
+
echo " colmap model_converter ..."
|
| 53 |
+
colmap model_converter \
|
| 54 |
+
--input_path ${exp_folder_colmap}/0 --output_path ${exp_folder_colmap} --output_type TXT
|
| 55 |
+
|
| 56 |
+
|
glomap_reconstruction.sh
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Default values
|
| 4 |
+
matcher_type="exhaustive"
|
| 5 |
+
use_gpu="1"
|
| 6 |
+
verbose="0"
|
| 7 |
+
settings_yaml=""
|
| 8 |
+
sequence_path=""
|
| 9 |
+
exp_folder=""
|
| 10 |
+
exp_id=""
|
| 11 |
+
calibration_yaml=""
|
| 12 |
+
rgb_csv=""
|
| 13 |
+
camera_name="rgb_0"
|
| 14 |
+
|
| 15 |
+
# Function to split key-value pairs and assign them to variables
|
| 16 |
+
split_and_assign() {
|
| 17 |
+
local input=$1
|
| 18 |
+
local key=$(echo $input | cut -d':' -f1)
|
| 19 |
+
local value=$(echo $input | cut -d':' -f2-)
|
| 20 |
+
eval $key=$value
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
# Read Inputs
|
| 24 |
+
for ((i=1; i<=$#; i++)); do
|
| 25 |
+
split_and_assign "${!i}"
|
| 26 |
+
done
|
| 27 |
+
|
| 28 |
+
exp_id=$(printf "%05d" ${exp_id})
|
| 29 |
+
|
| 30 |
+
echo -e "\n================= Experiment Configuration ================="
|
| 31 |
+
echo " Sequence Path : $sequence_path"
|
| 32 |
+
echo " Experiment Folder : $exp_folder"
|
| 33 |
+
echo " Experiment ID : $exp_id"
|
| 34 |
+
echo " Verbose : $verbose"
|
| 35 |
+
echo " Matcher Type : $matcher_type"
|
| 36 |
+
echo " Use GPU : $use_gpu"
|
| 37 |
+
echo " Settings YAML : $settings_yaml"
|
| 38 |
+
echo " Calibration YAML : $calibration_yaml"
|
| 39 |
+
echo " RGB CSV : $rgb_csv"
|
| 40 |
+
echo "============================================================"
|
| 41 |
+
|
| 42 |
+
# Create folder to save colmap files
|
| 43 |
+
exp_folder_colmap="${exp_folder}/colmap_${exp_id}"
|
| 44 |
+
rm -rf "$exp_folder_colmap"
|
| 45 |
+
mkdir "$exp_folder_colmap"
|
| 46 |
+
|
| 47 |
+
# Run COLMAP scripts for matching and mapping
|
| 48 |
+
export QT_QPA_PLATFORM_PLUGIN_PATH="$CONDA_PREFIX/plugins/platforms"
|
| 49 |
+
colmap_args="$sequence_path $exp_folder $exp_id $settings_yaml $calibration_yaml $rgb_csv"
|
| 50 |
+
./Baselines/colmap/colmap_matcher.sh $colmap_args $matcher_type $use_gpu $camera_name
|
| 51 |
+
./Baselines/glomap/glomap_mapper.sh $colmap_args $camera_name
|
| 52 |
+
|
| 53 |
+
# Convert COLMAP outputs to a format suitable for VSLAM-LAB
|
| 54 |
+
python Baselines/colmap/colmap_to_vslamlab.py $sequence_path $exp_folder $exp_id $verbose $rgb_csv $camera_name
|
| 55 |
+
|
| 56 |
+
# Visualization with colmap gui
|
| 57 |
+
if [ "$verbose" -eq 1 ]; then
|
| 58 |
+
exp_folder_colmap="${exp_folder}/colmap_${exp_id}"
|
| 59 |
+
rgb_dir=$(awk -F, 'NR==2 { split($2,a,"/"); print a[1]; exit }' "$rgb_csv")
|
| 60 |
+
rgb_path="${sequence_path}/${rgb_dir}"
|
| 61 |
+
database="${exp_folder_colmap}/colmap_database.db"
|
| 62 |
+
colmap gui --import_path "${exp_folder_colmap}/0" --database_path ${database} --image_path ${rgb_path}
|
| 63 |
+
fi
|
| 64 |
+
|
| 65 |
+
# # Remove colmap data
|
| 66 |
+
# rm -rf ${exp_folder_colmap}
|
| 67 |
+
|
vslamlab_glomap_settings.yaml
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
feature_extractor:
|
| 2 |
+
SiftExtraction_num_octaves: 4
|
| 3 |
+
SiftExtraction_octave_resolution: 3
|
| 4 |
+
SiftExtraction_peak_threshold: 0.0066666666666666671
|
| 5 |
+
SiftExtraction_edge_threshold: 10.0
|
| 6 |
+
SiftExtraction_dsp_min_scale: 0.1666666666666666
|
| 7 |
+
SiftExtraction_dsp_max_scale: 3.0
|
| 8 |
+
SiftExtraction_dsp_num_scales: 10
|
| 9 |
+
|
| 10 |
+
matcher:
|
| 11 |
+
SiftMatching_max_ratio: 0.80000000000000004
|
| 12 |
+
SiftMatching_max_distance: 0.69999999999999996
|
| 13 |
+
TwoViewGeometry_min_num_inliers: 15
|
| 14 |
+
TwoViewGeometry_max_error: 4.0
|
| 15 |
+
TwoViewGeometry_confidence: 0.999
|
| 16 |
+
TwoViewGeometry_min_inlier_ratio: 0.25
|
| 17 |
+
SequentialMatching_overlap: 10
|
| 18 |
+
SequentialMatching_quadratic_overlap: 1
|
| 19 |
+
ExhaustiveMatching_block_size: 50
|
| 20 |
+
|
| 21 |
+
ba:
|
| 22 |
+
iteration_num: 3
|
| 23 |
+
|
| 24 |
+
retriangulation:
|
| 25 |
+
iteration_num: 1
|
| 26 |
+
|
| 27 |
+
skip:
|
| 28 |
+
preprocessing: 0
|
| 29 |
+
view_graph_calibration: 0
|
| 30 |
+
relative_pose_estimation: 0
|
| 31 |
+
rotation_averaging: 0
|
| 32 |
+
global_positioning: 0
|
| 33 |
+
bundle_adjustment: 0
|
| 34 |
+
retriangulation_stage: 0
|
| 35 |
+
pruning: 0
|
| 36 |
+
|
| 37 |
+
ViewGraphCalib:
|
| 38 |
+
thres_lower_ratio: 0.10000000000000001
|
| 39 |
+
thres_higher_ratio: 10.0
|
| 40 |
+
thres_two_view_error: 2.0
|
| 41 |
+
|
| 42 |
+
RelPoseEstimation:
|
| 43 |
+
max_epipolar_error: 1.
|
| 44 |
+
|
| 45 |
+
TrackEstablishment:
|
| 46 |
+
min_num_tracks_per_view: -1
|
| 47 |
+
min_num_view_per_track: 3
|
| 48 |
+
max_num_view_per_track: 100
|
| 49 |
+
max_num_tracks: 10000000
|
| 50 |
+
|
| 51 |
+
GlobalPositioning:
|
| 52 |
+
optimize_positions: 1
|
| 53 |
+
optimize_points: 1
|
| 54 |
+
optimize_scales: 1
|
| 55 |
+
thres_loss_function: 0.10000000000000001
|
| 56 |
+
max_num_iterations: 100
|
| 57 |
+
|
| 58 |
+
BundleAdjustment:
|
| 59 |
+
optimize_rotations: 1
|
| 60 |
+
optimize_translation: 1
|
| 61 |
+
optimize_intrinsics: 1
|
| 62 |
+
optimize_points: 1
|
| 63 |
+
thres_loss_function: 1.0
|
| 64 |
+
max_num_iterations: 200
|
| 65 |
+
|
| 66 |
+
Triangulation:
|
| 67 |
+
complete_max_reproj_error: 15.0
|
| 68 |
+
merge_max_reproj_error: 15.0
|
| 69 |
+
min_angle: 1.0
|
| 70 |
+
min_num_matches: 15
|
| 71 |
+
|
| 72 |
+
Thresholds:
|
| 73 |
+
max_epipolar_error_E: 1.0
|
| 74 |
+
max_epipolar_error_F: 4.0
|
| 75 |
+
max_epipolar_error_H: 4.0
|
| 76 |
+
min_inlier_num: 30.0
|
| 77 |
+
min_inlier_ratio: 0.25
|
| 78 |
+
max_rotation_error: 10.0
|