diff --git a/README b/README deleted file mode 100644 index e69de29b..00000000 diff --git a/bin/convert_vlsift_to_lowesift.pl b/bin/convert_vlsift_to_lowesift.pl deleted file mode 100755 index 153e780e..00000000 --- a/bin/convert_vlsift_to_lowesift.pl +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/local/bin/perl - -$filename = $ARGV[0]; - -open (DEST, ">$filename.key"); -open (SRC, "$filename.key.tmp"); - -$resolution_line = `jhead $filename.jpg | grep "Resolution"`; -($res_x, $res_y) = $resolution_line =~ /: ([0-9]*) x ([0-9]*)/; - -$linecount = 0; -$linecount += tr/\n/\n/ while sysread(SRC, $_, 2 ** 16); - -seek(SRC, 0, 0); - -print DEST $linecount; -print DEST " 128\n"; - -printf ("found %d features in %s.jpg\n\n", $linecount, $filename); - -while ($record = ) { - @parts = split(/ /, $record); - - $counter = 0; - - $parts[0] = $res_x-$parts[0]; - - foreach (@parts) { - - if((($counter-4) % 20) == 0) { - print DEST "\n "; - } else { - if($counter != 0){ - print DEST " "; - } - } - - print DEST $_; - - $counter++; - } -} - -close(DEST); -close(SRC); \ No newline at end of file diff --git a/defs.sh b/defs.sh deleted file mode 100755 index 439066d8..00000000 --- a/defs.sh +++ /dev/null @@ -1,47 +0,0 @@ -set -o nounset -set -o errexit - -#if [ ! -n "$0" ]; then - TOOLS_PATH=$PWD/$(dirname $0) -#else -# TOOLS_PATH=$PWD -#fi - -IMAGE_DIR="." - -## paths for the tools -TOOLS_BIN_PATH=$TOOLS_PATH/bin -TOOLS_INC_PATH=$TOOLS_PATH/include -TOOLS_LIB_PATH=$TOOLS_PATH/lib -TOOLS_SRC_PATH=$TOOLS_PATH/src -TOOLS_LOG_PATH=$TOOLS_PATH/logs - -## loacal dest paths -LIB_PATH="/usr/local/lib" -INC_PATH="/usr/local/include" - -## source paths -BUNDLER_PATH="$TOOLS_SRC_PATH/bundler" -CMVS_PATH="$TOOLS_SRC_PATH/cmvs" -PMVS_PATH="$TOOLS_SRC_PATH/pmvs" -GRACLUS_PATH="$TOOLS_SRC_PATH/graclus" -CLAPACK_PATH="$TOOLS_SRC_PATH/clapack" -OPENCV_PATH="$TOOLS_SRC_PATH/openCv" -VLFEAT_PATH="$TOOLS_SRC_PATH/vlfeat" -SIFT_PATH="$TOOLS_SRC_PATH/sift" -PARALLEL_PATH="$TOOLS_SRC_PATH/parallel" -PSR_PATH="$TOOLS_SRC_PATH/PoissonRecon" - -## executables -EXTRACT_FOCAL=$TOOLS_BIN_PATH/extract_focal.pl -MATCHKEYS=$TOOLS_BIN_PATH/KeyMatchFull -BUNDLER=$TOOLS_BIN_PATH/bundler -BUNDLE2PVMS=$TOOLS_BIN_PATH/Bundle2PMVS -CMVS=$TOOLS_BIN_PATH/cmvs -PMVS=$TOOLS_BIN_PATH/pmvs2 -GENOPTION=$TOOLS_BIN_PATH/genOption -SIFT=$TOOLS_BIN_PATH/sift -VLSIFT=$TOOLS_BIN_PATH/vlsift -PARALLEL=$TOOLS_BIN_PATH/parallel -PSR=$TOOLS_BIN_PATH/PoissonRecon -VLSIFT_TO_LOWESIFT=$TOOLS_BIN_PATH/convert_vlsift_to_lowesift.pl \ No newline at end of file diff --git a/run-0-mogrify.sh b/run-0-mogrify.sh deleted file mode 100755 index 30fd7be2..00000000 --- a/run-0-mogrify.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -script_dir=$(dirname $0) -. $script_dir/defs.sh - -echo -echo " - scaling images" -echo - -# Rename ".JPG" to ".jpg" -for d in `ls -1 $IMAGE_DIR | egrep ".JPG$"` -do - mv $d `echo $d | sed 's/\.JPG/\.jpg/'` -done - -mogrify -resize 1600x1200 -quality 100 * - -echo -echo " < done - `date`" - -exit diff --git a/run-1-get-keypoints.sh b/run-1-get-keypoints.sh deleted file mode 100755 index 081dfc0f..00000000 --- a/run-1-get-keypoints.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -script_dir=$(dirname $0) -. $script_dir/defs.sh - -echo -echo " - running $VLSIFT (will take some time ...)" -echo - -# Create the list of images -find $IMAGE_DIR -maxdepth 1 | egrep ".jpg$" | sort > list_tmp.txt -$EXTRACT_FOCAL list_tmp.txt -cp prepare/list.txt . - -rm -f match_jobs.txt - -for d in `ls -1 $IMAGE_DIR | egrep "jpg$"` -do - key_file=`echo $d | sed 's/jpg$/key/'` - pgm_file=`echo $d | sed 's/jpg$/pgm/'` - base_file=`echo $d | sed 's/\.jpg$//'` - jpg_file=`echo $d` - - VLSIFT_CMD="mogrify -format pgm $IMAGE_DIR/$jpg_file; $VLSIFT -o $IMAGE_DIR/$key_file.tmp $IMAGE_DIR/$pgm_file; rm $IMAGE_DIR/$pgm_file; perl $VLSIFT_TO_LOWESIFT $base_file; rm $IMAGE_DIR/$key_file.tmp; gzip -f $IMAGE_DIR/$key_file" - SIFT_CMD="mogrify -format pgm $IMAGE_DIR/$jpg_file; $SIFT < $IMAGE_DIR/$pgm_file > $IMAGE_DIR/$key_file; rm $IMAGE_DIR/$pgm_file; gzip -f $IMAGE_DIR/$key_file" - - echo $SIFT_CMD >> match_jobs.txt - -## eval $SIFT_CMD -done - -$PARALLEL -j+0 < match_jobs.txt - -wait - -echo -echo " < done - `date`" - -exit diff --git a/run-1.sh b/run-1.sh deleted file mode 100755 index 5a072767..00000000 --- a/run-1.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -BASE_PATH=$(dirname $(which $0)); -IMAGE_DIR="." - -EXTRACT_FOCAL=$BASE_PATH/bin/extract_focal.pl -MATCHKEYS=$BASE_PATH/bin/KeyMatchFull -BUNDLER=$BASE_PATH/bin/bundler -BUNDLE2PVMS=$BASE_PATH/bin/Bundle2PMVS -CMVS=$BASE_PATH/bin/cmvs -PMVS=$BASE_PATH/bin/pmvs2 -GENOPTION=$BASE_PATH/bin/genOption -SIFT=$BASE_PATH/bin/sift -SIFTFEAT=$BASE_PATH/siftfeat -VLSIFT=$BASE_PATH/bin/vlsift - -if [ $# -eq 1 ] -then - echo "Using directory '$1'" - IMAGE_DIR=$1 -fi - -# Rename ".JPG" to ".jpg" -for d in `ls -1 $IMAGE_DIR | egrep ".JPG$"` -do - mv $d `echo $d | sed 's/\.JPG/\.jpg/'` -done - -# Create the list of images -find $IMAGE_DIR -maxdepth 1 | egrep ".jpg$" | sort > list_tmp.txt -$EXTRACT_FOCAL list_tmp.txt -cp prepare/list.txt . - -echo -echo '[- Extracting keypoints -]' -echo - -for d in `ls -1 $IMAGE_DIR | egrep "jpg$"` -do - key_file=`echo $d | sed 's/jpg$/key/'` - pgm_file=`echo $d | sed 's/jpg$/pgm/'` - jpg_file=`echo $d` - -# SIFT_CMD="$VLSIFT -o $IMAGE_DIR/$key_file -x $IMAGE_DIR/$jpg_file; gzip -f $IMAGE_DIR/$key_file" -# SIFT_CMD="mogrify -format pgm $IMAGE_DIR/$jpg_file; $VLSIFT < $IMAGE_DIR/$pgm_file > $IMAGE_DIR/$key_file; rm $IMAGE_DIR/$pgm_file; gzip -f $IMAGE_DIR/$key_file" - SIFT_CMD="mogrify -format pgm $IMAGE_DIR/$jpg_file; $SIFT < $IMAGE_DIR/$pgm_file > $IMAGE_DIR/$key_file; rm $IMAGE_DIR/$pgm_file; gzip -f $IMAGE_DIR/$key_file" - eval $SIFT_CMD -done - -exit diff --git a/run-2-match-keypoints.sh b/run-2-match-keypoints.sh deleted file mode 100755 index f59b7713..00000000 --- a/run-2-match-keypoints.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -script_dir=$(dirname $0) -. $script_dir/defs.sh - -echo -echo " - running $MATCHKEYS (will take some time ...)" -echo - -sed 's/\.jpg$/\.key/' $IMAGE_DIR/list_tmp.txt > $IMAGE_DIR/list_keys.txt - -echo $MATCHKEYS $IMAGE_DIR/list_keys.txt $IMAGE_DIR/matches.init.txt -$MATCHKEYS $IMAGE_DIR/list_keys.txt $IMAGE_DIR/matches.init.txt - -echo -echo " < done - `date`" - -exit diff --git a/run-3-bundler.sh b/run-3-bundler.sh deleted file mode 100755 index 973732b2..00000000 --- a/run-3-bundler.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -script_dir=$(dirname $0) -. $script_dir/defs.sh - -echo -echo " - running $BUNDLER" -echo - -mkdir bundle -rm -f $IMAGE_DIR/options.txt - -echo "--match_table matches.init.txt" >> options.txt -echo "--output bundle.out" >> options.txt -echo "--output_all bundle_" >> options.txt -echo "--output_dir bundle" >> options.txt -echo "--variable_focal_length" >> options.txt -echo "--use_focal_estimate" >> options.txt -echo "--constrain_focal" >> options.txt -echo "--constrain_focal_weight 0.0001" >> options.txt -echo "--estimate_distortion" >> options.txt -echo "--run_bundle" >> options.txt - -rm -f $IMAGE_DIR/constraints.txt -rm -f $IMAGE_DIR/pairwise_scores.txt -$BUNDLER $IMAGE_DIR/list.txt --options_file $IMAGE_DIR/options.txt > $IMAGE_DIR/bundle/out - -echo -echo " < done - `date`" - -exit diff --git a/run-4-bundle2pmvs.sh b/run-4-bundle2pmvs.sh deleted file mode 100755 index 7f264dd6..00000000 --- a/run-4-bundle2pmvs.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -script_dir=$(dirname $0) -. $script_dir/defs.sh - -echo -echo " - running $BUNDLE2PVMS" -echo - -$BUNDLE2PVMS list.txt bundle/bundle.out - -sed -i $IMAGE_DIR/pmvs/prep_pmvs.sh -e "4c\BUNDLER_BIN_PATH=\"$TOOLS_BIN_PATH\"" -sh $IMAGE_DIR/pmvs/prep_pmvs.sh - -echo -echo " < done - `date`" - -exit diff --git a/run-5-cmvs.sh b/run-5-cmvs.sh deleted file mode 100755 index 176d8417..00000000 --- a/run-5-cmvs.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -script_dir=$(dirname $0) -. $script_dir/defs.sh - -echo -echo " - running $CMVS" -echo - -$CMVS pmvs/ 100 4 - -echo -echo " < done - `date`" - -exit diff --git a/run-6-genOption.sh b/run-6-genOption.sh deleted file mode 100755 index 34bd7f8e..00000000 --- a/run-6-genOption.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -script_dir=$(dirname $0) -. $script_dir/defs.sh - -echo -echo " - running $GENOPTION" -echo - -$GENOPTION pmvs/ - -echo -echo " < done - `date`" - -exit diff --git a/run-7-pmvs.sh b/run-7-pmvs.sh deleted file mode 100755 index 7ff7df8b..00000000 --- a/run-7-pmvs.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -script_dir=$(dirname $0) -. $script_dir/defs.sh - -echo -echo " - running $PMVS" -echo - - -$PMVS pmvs/ option-0000 - -echo -echo " < done - `date`" - -exit diff --git a/run-all.sh b/run-all.sh deleted file mode 100755 index bc3f8499..00000000 --- a/run-all.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -BASE_PATH=$(dirname $(which $0)); - -sh $BASE_PATH/run-0-mogrify.sh -sh $BASE_PATH/run-1-get-keypoints.sh -sh $BASE_PATH/run-2-match-keypoints.sh -sh $BASE_PATH/run-3-bundler.sh -sh $BASE_PATH/run-4-bundle2pmvs.sh -sh $BASE_PATH/run-5-cmvs.sh -sh $BASE_PATH/run-6-genOption.sh -sh $BASE_PATH/run-7-pmvs.sh - -exit diff --git a/run.sh b/run.sh deleted file mode 100755 index cc290cb5..00000000 --- a/run.sh +++ /dev/null @@ -1,124 +0,0 @@ -BASE_PATH=$(dirname $(which $0)); -IMAGE_DIR="." - -EXTRACT_FOCAL=$BASE_PATH/extract_focal.pl -MATCHKEYS=$BASE_PATH/KeyMatchFull -BUNDLER=$BASE_PATH/bundler -BUNDLE2PVMS=$BASE_PATH/Bundle2PMVS -CMVS=$BASE_PATH/cmvs -PMVS=$BASE_PATH/pmvs2 -GENOPTION=$BASE_PATH/genOption -SIFT=$BASE_PATH/sift -SIFTFEAT=$BASE_PATH/siftfeat - -if [ $# -eq 1 ] -then - echo "Using directory '$1'" - IMAGE_DIR=$1 -fi - -# Rename ".JPG" to ".jpg" -for d in `ls -1 $IMAGE_DIR | egrep ".JPG$"` -do - mv $d `echo $d | sed 's/\.JPG/\.jpg/'` -done - -echo -echo '[- Scaling images -]' -echo - -mogrify -resize 1600x1200 -quality 100 * - -# Create the list of images -find $IMAGE_DIR -maxdepth 1 | egrep ".jpg$" | sort > list_tmp.txt -$EXTRACT_FOCAL list_tmp.txt -cp prepare/list.txt . - -echo -echo '[- Extracting keypoints -]' -echo - -for d in `ls -1 $IMAGE_DIR | egrep "jpg$"` -do - key_file=`echo $d | sed 's/jpg$/key/'` - pgm_file=`echo $d | sed 's/jpg$/pgm/'` - jpg_file=`echo $d` - - SIFT_CMD="$SIFTFEAT -o $IMAGE_DIR/$key_file -x $IMAGE_DIR/$jpg_file; gzip -f $IMAGE_DIR/$key_file" -# SIFT_CMD="mogrify -format pgm $IMAGE_DIR/$jpg_file; $SIFT < $IMAGE_DIR/$pgm_file > $IMAGE_DIR/$key_file; rm $IMAGE_DIR/$pgm_file; gzip -f $IMAGE_DIR/$key_file" - eval $SIFT_CMD -done - -# Match images (can take a while) -echo -echo '[- Matching keypoints (this can take a while) -]' -echo - -sed 's/\.jpg$/\.key/' $IMAGE_DIR/list_tmp.txt > $IMAGE_DIR/list_keys.txt - -echo $MATCHKEYS $IMAGE_DIR/list_keys.txt $IMAGE_DIR/matches.init.txt -$MATCHKEYS $IMAGE_DIR/list_keys.txt $IMAGE_DIR/matches.init.txt - -mkdir bundle -rm -f $IMAGE_DIR/options.txt - -echo "--match_table matches.init.txt" >> options.txt -echo "--output bundle.out" >> options.txt -echo "--output_all bundle_" >> options.txt -echo "--output_dir bundle" >> options.txt -echo "--variable_focal_length" >> options.txt -echo "--use_focal_estimate" >> options.txt -echo "--constrain_focal" >> options.txt -echo "--constrain_focal_weight 0.0001" >> options.txt -echo "--estimate_distortion" >> options.txt -echo "--run_bundle" >> options.txt - -# Run Bundler! -echo -echo '[- Running Bundler -]' -echo - -rm -f $IMAGE_DIR/constraints.txt -rm -f $IMAGE_DIR/pairwise_scores.txt -$BUNDLER $IMAGE_DIR/list.txt --options_file $IMAGE_DIR/options.txt > $IMAGE_DIR/bundle/out - -# Run Bundle2PMVS! -echo -echo '[- Running Bundle2PMVS -]' -echo - -$BUNDLE2PVMS list.txt bundle/bundle.out - -# Run prep_pmvs! -echo -echo '[- Running prep_pmvs -]' -echo - -sed -i $IMAGE_DIR/pmvs/prep_pmvs.sh -e "4c\BUNDLER_BIN_PATH=\"$BASE_PATH\"" -sh pmvs/prep_pmvs.sh - -# Run cmvs! -echo -echo '[- Running cmvs -]' -echo - -$CMVS pmvs/ 20 - -# Run pmvs! -echo -echo '[- Running genOption -]' -echo - -$GENOPTION pmvs/ - -# Run prep_pmvs! -echo -echo '[- Running pmvs -]' -echo - -$PMVS pmvs/ option-0000 -#sh pmvs/pmvs.sh - -echo -echo '[- Done -]' -echo \ No newline at end of file