v02
This commit is contained in:
59
mono-kitti/dso_mono_kitti_examples.sh
Normal file
59
mono-kitti/dso_mono_kitti_examples.sh
Normal file
@@ -0,0 +1,59 @@
|
||||
#! /bin/bash
|
||||
|
||||
echo " "
|
||||
echo "Script for running DSO on Monocular KITTI dataset."
|
||||
echo "--------------------------------------------------------"
|
||||
|
||||
export DIR_DATASET=/home/ivan/ivan/git/work_drivecast2/SLAM/datasets/mono-kitti/sequences
|
||||
#export DSO_BINARY_DIR=/home/ivan/ivan/git/work_drivecast2/SLAM/dso/build/bin
|
||||
export DSO_BINARY_DIR=/home/ivan/ivan/git/work_drivecast2/SLAM/dso/cmake-build-debug/bin
|
||||
|
||||
function show_help {
|
||||
echo "--------------------------------------------------------"
|
||||
echo "Example of usage: -d=00 or --dataset=01. They are used to as the
|
||||
folder names in KITTI dataset folder. Output file doesn't change the name. Don't forget to rename and move the
|
||||
result before the next run."
|
||||
}
|
||||
|
||||
if [[ ($1 == -h || $1 == --help) ]] ; then
|
||||
show_help
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for i in "$@"; do
|
||||
case "$i" in
|
||||
-d=*|--dataset=*)
|
||||
export DATASET="${i#*=}"
|
||||
export DATASET_DIR="$DIR_DATASET"/"$DATASET"
|
||||
# echo "$DATASET:"
|
||||
shift
|
||||
;;
|
||||
-*|--*)
|
||||
echo "Unknown option $i"
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "Invalid usage."
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "$DATASET dataset starting..."
|
||||
"$DSO_BINARY_DIR"/dso_dataset files="$DATASET_DIR"/image_0 calib="$DATASET_DIR"/camera.txt preset=0 mode=1
|
||||
|
||||
export FILENAME="${DATASET}_mono_dso.txt"
|
||||
mv result.txt "$DATASET"/"$FILENAME"
|
||||
mv result_online.txt "$DATASET"/"${DATASET}_mono_dso_online.txt"
|
||||
|
||||
# The dataset and the directory have the same name.
|
||||
./converter "$DATASET" "$FILENAME"
|
||||
./converter "$DATASET" "${DATASET}_mono_dso_online.txt"
|
||||
|
||||
export CONVERTED_FILENAME="f_${DATASET}_mono_dso.txt"
|
||||
mv "$DATASET"/"${DATASET}_mono_dso_converted.txt" "${DATASET}"/"$CONVERTED_FILENAME"
|
||||
mv "$DATASET"/"${DATASET}_mono_dso_online_converted.txt" "${DATASET}"/"f_${DATASET}_mono_dso_online.txt"
|
||||
|
||||
echo "Success! Check $DATASET directory for the output file "
|
||||
Reference in New Issue
Block a user