kopia lustrzana https://github.com/OpenDroneMap/ODM
pull
rodzic
be4990ced5
commit
c6f6d80e93
|
@ -14,6 +14,7 @@
|
|||
"Canon Canon DIGITAL IXUS 750" => 7.176, # 1/1.8"
|
||||
"Canon Canon DIGITAL IXUS 800 IS" => 5.76, # 1/2.5"
|
||||
"Canon Canon DIGITAL IXUS II" => 5.27, # 1/2.7"
|
||||
"Canon Canon DIGITAL IXUS 430" => 6.18, # 1/2.3"
|
||||
"Canon Canon EOS 10D" => 22.7,
|
||||
"Canon Canon EOS-1D Mark II" => 28.7,
|
||||
"Canon Canon EOS-1Ds Mark II" => 35.95,
|
||||
|
@ -160,6 +161,7 @@
|
|||
"NIKON CORPORATION NIKON D70" => 23.7,
|
||||
"NIKON CORPORATION NIKON D70s" => 23.7,
|
||||
"NIKON CORPORATION NIKON D80" => 23.6,
|
||||
"NIKON CORPORATION NIKON D700" => 36.0,
|
||||
"NIKON E2500" => 5.27, # 1/2.7"
|
||||
"NIKON E2500" => 5.27, # 1/2.7"
|
||||
"NIKON E3100" => 5.27, # 1/2.7"
|
||||
|
@ -195,7 +197,8 @@
|
|||
"OLYMPUS CORPORATION X250,D560Z,C350Z" => 5.76, # 1/2.5"
|
||||
"OLYMPUS CORPORATION X-3,C-60Z" => 7.176, # 1.8"
|
||||
"OLYMPUS CORPORATION X400,D580Z,C460Z" => 5.27, # 1/2.7"
|
||||
"OLYMPUS IMAGING CORP. E-500" => 17.3, # 4/3?
|
||||
"OLYMPUS IMAGING CORP. E-500" => 17.3, # 4/3?
|
||||
"OLYMPUS IMAGING CORP. E-510" => 17.3,
|
||||
"OLYMPUS IMAGING CORP. FE115,X715" => 5.76, # 1/2.5"
|
||||
"OLYMPUS IMAGING CORP. SP310" => 7.176, # 1/1.8"
|
||||
"OLYMPUS IMAGING CORP. SP510UZ" => 5.75, # 1/2.5"
|
||||
|
@ -228,6 +231,7 @@
|
|||
"Panasonic DMC-LZ2" => 5.76, # 1/2.5"
|
||||
"Panasonic DMC-TZ1" => 5.75, # 1/2.5"
|
||||
"Panasonic DMC-TZ3" => 5.68, # 1/2.35"
|
||||
"Panasonic DMC-TZ5" => 6.12, # 1/2.33"
|
||||
"PENTAX Corporation PENTAX *ist DL" => 23.5,
|
||||
"PENTAX Corporation PENTAX *ist DS2" => 23.5,
|
||||
"PENTAX Corporation PENTAX *ist DS" => 23.5,
|
||||
|
@ -270,4 +274,4 @@
|
|||
"SONY DSC-W5" => 7.176, # 1/1.8"
|
||||
"SONY DSC-W7" => 7.176, # 1/1.8"
|
||||
"SONY DSC-W80" => 5.75, # 1/2.5"
|
||||
);
|
||||
);
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
#!/usr/local/bin/perl
|
||||
|
||||
$filename_base = $ARGV[0];
|
||||
|
||||
|
||||
$write_binary = 1;
|
||||
|
||||
$filename_src = $filename_base.".key.sift";
|
||||
$filename_dest = $filename_base.".key";
|
||||
$filename_image = $filename_base.".jpg";
|
||||
$filename_dest = $filename_base.($write_binary ? ".key.bin" : ".key");
|
||||
$filename_image = $filename_base.".jpg";
|
||||
|
||||
open (DEST, ">$filename_dest");
|
||||
open (SRC, "$filename_src");
|
||||
|
@ -16,58 +18,90 @@ $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 (%d x %d)\n", $linecount, $filename_image, $res_x, $res_y);
|
||||
if($write_binary){
|
||||
print DEST pack("L", $linecount);
|
||||
|
||||
while ($record = <SRC>) {
|
||||
@parts = split(/ /, $record);
|
||||
|
||||
$counter = 0;
|
||||
|
||||
if(@parts[3] > 3.141){
|
||||
@parts[3] -= 6.282;
|
||||
}
|
||||
|
||||
@parts[3] *= -1;
|
||||
|
||||
printf (DEST "%.3f %.3f %.3f %.3f", @parts[1], @parts[0], @parts[2], @parts[3]);
|
||||
|
||||
shift(@parts);
|
||||
shift(@parts);
|
||||
shift(@parts);
|
||||
shift(@parts);
|
||||
|
||||
for ($count = 0; $count < 128; $count += 8) {
|
||||
@tmp = @parts[$count+7];
|
||||
@parts[$count+7] = @parts[$count+1];
|
||||
@parts[$count+1] = @tmp;
|
||||
while ($record = <SRC>) {
|
||||
@parts = split(/ /, $record);
|
||||
|
||||
@tmp = @parts[$count+6];
|
||||
@parts[$count+6] = @parts[$count+2];
|
||||
@parts[$count+2] = @tmp;
|
||||
if(@parts[3] > 3.141){
|
||||
@parts[3] -= 6.282;
|
||||
}
|
||||
|
||||
@parts[3] *= -1;
|
||||
|
||||
@tmp = @parts[$count+3];
|
||||
@parts[$count+3] = @parts[$count+5];
|
||||
@parts[$count+5] = @tmp;
|
||||
@tmp = @parts[0];
|
||||
@parts[0] = @parts[1];
|
||||
@parts[1] = @tmp;
|
||||
|
||||
for ($count = 4; $count < 132; $count += 8) {
|
||||
@tmp = @parts[$count+7];
|
||||
@parts[$count+7] = @parts[$count+1];
|
||||
@parts[$count+1] = @tmp;
|
||||
|
||||
@tmp = @parts[$count+6];
|
||||
@parts[$count+6] = @parts[$count+2];
|
||||
@parts[$count+2] = @tmp;
|
||||
|
||||
@tmp = @parts[$count+3];
|
||||
@parts[$count+3] = @parts[$count+5];
|
||||
@parts[$count+5] = @tmp;
|
||||
}
|
||||
|
||||
print DEST pack("f4 C128", @parts);
|
||||
}
|
||||
} else {
|
||||
print DEST $linecount, " 128\n";
|
||||
|
||||
while ($record = <SRC>) {
|
||||
@parts = split(/ /, $record);
|
||||
|
||||
foreach (@parts) {
|
||||
if((($counter) % 20) == 0) {
|
||||
print DEST "\n ";
|
||||
} else {
|
||||
if($counter != 0){
|
||||
print DEST " ";
|
||||
}
|
||||
$counter = 0;
|
||||
|
||||
if(@parts[3] > 3.141){
|
||||
@parts[3] -= 6.282;
|
||||
}
|
||||
|
||||
@parts[3] *= -1;
|
||||
|
||||
printf (DEST "%.3f %.3f %.3f %.3f", @parts[1], @parts[0], @parts[2], @parts[3]);
|
||||
|
||||
shift(@parts);
|
||||
shift(@parts);
|
||||
shift(@parts);
|
||||
shift(@parts);
|
||||
|
||||
for ($count = 0; $count < 128; $count += 8) {
|
||||
@tmp = @parts[$count+7];
|
||||
@parts[$count+7] = @parts[$count+1];
|
||||
@parts[$count+1] = @tmp;
|
||||
|
||||
print DEST $_;
|
||||
@tmp = @parts[$count+6];
|
||||
@parts[$count+6] = @parts[$count+2];
|
||||
@parts[$count+2] = @tmp;
|
||||
|
||||
$counter++;
|
||||
}
|
||||
}
|
||||
@tmp = @parts[$count+3];
|
||||
@parts[$count+3] = @parts[$count+5];
|
||||
@parts[$count+5] = @tmp;
|
||||
}
|
||||
|
||||
foreach (@parts) {
|
||||
if((($counter) % 20) == 0) {
|
||||
print DEST "\n ";
|
||||
} else {
|
||||
if($counter != 0){
|
||||
print DEST " ";
|
||||
}
|
||||
}
|
||||
|
||||
print DEST $_;
|
||||
|
||||
$counter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close(DEST);
|
||||
close(SRC);
|
|
@ -120,7 +120,7 @@ clapack.tgz http://www.netlib.org/clapack/clapack-3.2.1-CMAKE.tgz
|
|||
bundler.zip http://phototour.cs.washington.edu/bundler/distr/bundler-v0.4-source.zip
|
||||
graclus.tar.gz https://www.topoi.hu-berlin.de/graclus1.2.tar.gz
|
||||
PoissonRecon.zip http://www.cs.jhu.edu/~misha/Code/PoissonRecon/Version2/PoissonRecon.zip
|
||||
cmvs.tar.gz http://grail.cs.washington.edu/software/cmvs/cmvs-fix1.tar.gz
|
||||
cmvs.tar.gz http://grail.cs.washington.edu/software/cmvs/cmvs-fix2.tar.gz
|
||||
EOF
|
||||
|
||||
echo " < done - `date`"
|
||||
|
|
|
@ -23,6 +23,7 @@ echo " - script started - `date`"
|
|||
TOOLS_LIB_PATH="$TOOLS_PATH/lib"
|
||||
TOOLS_SRC_PATH="$TOOLS_PATH/src"
|
||||
TOOLS_LOG_PATH="$TOOLS_PATH/logs"
|
||||
TOOLS_PATCHED_PATH="$TOOLS_PATH/patched_files"
|
||||
## loacal dest paths
|
||||
LIB_PATH="/usr/local/lib"
|
||||
INC_PATH="/usr/local/include"
|
||||
|
@ -38,7 +39,8 @@ echo " - script started - `date`"
|
|||
PSR_PATH="$TOOLS_SRC_PATH/PoissonRecon"
|
||||
## executables
|
||||
EXTRACT_FOCAL="$TOOLS_BIN_PATH/extract_focal.pl"
|
||||
MATCHKEYS="$TOOLS_BIN_PATH/KeyMatchFull"
|
||||
MATCHKEYS="$TOOLS_BIN_PATH/KeyMatch"
|
||||
MATCHKEYSFULL="$TOOLS_BIN_PATH/KeyMatchFull"
|
||||
BUNDLER="$TOOLS_BIN_PATH/bundler"
|
||||
BUNDLE2PVMS="$TOOLS_BIN_PATH/Bundle2PMVS"
|
||||
CMVS="$TOOLS_BIN_PATH/cmvs"
|
||||
|
@ -57,7 +59,11 @@ CORES=`grep -c processor /proc/cpuinfo`
|
|||
LC_ALL=C
|
||||
|
||||
## removing old stuff
|
||||
rm -rf `ls -1 | egrep -v '\.zip$|\.tgz$|\.bz2$|\.gz$|\.sh$|\.pl$' | xargs`
|
||||
sudo rm -Rf "$TOOLS_BIN_PATH"
|
||||
sudo rm -Rf "$TOOLS_INC_PATH"
|
||||
sudo rm -Rf "$TOOLS_LIB_PATH"
|
||||
sudo rm -Rf "$TOOLS_SRC_PATH"
|
||||
sudo rm -Rf "$TOOLS_LOG_PATH"
|
||||
|
||||
## create needed directories
|
||||
mkdir -p "$TOOLS_BIN_PATH"
|
||||
|
@ -118,7 +124,7 @@ clapack.tgz http://www.netlib.org/clapack/clapack-3.2.1-CMAKE.tgz
|
|||
bundler.zip http://phototour.cs.washington.edu/bundler/distr/bundler-v0.4-source.zip
|
||||
graclus.tar.gz https://www.topoi.hu-berlin.de/graclus1.2.tar.gz
|
||||
PoissonRecon.zip http://www.cs.jhu.edu/~misha/Code/PoissonRecon/Version2/PoissonRecon.zip
|
||||
cmvs.tar.gz http://grail.cs.washington.edu/software/cmvs/cmvs-fix1.tar.gz
|
||||
cmvs.tar.gz http://grail.cs.washington.edu/software/cmvs/cmvs-fix2.tar.gz
|
||||
EOF
|
||||
|
||||
echo " < done - `date`"
|
||||
|
@ -147,7 +153,18 @@ mv -f cmvs "$CMVS_PATH"
|
|||
mv -f parallel-20100922 "$PARALLEL_PATH"
|
||||
mv -f PoissonRecon "$PSR_PATH"
|
||||
|
||||
echo " done - `date`"
|
||||
echo " < done - `date`"
|
||||
|
||||
|
||||
## copying patches
|
||||
echo
|
||||
echo " - copying patches"
|
||||
|
||||
for file in `find $TOOLS_PATCHED_PATH -type f -print` ; do
|
||||
cp $file $TOOLS_PATH/${file/$TOOLS_PATCHED_PATH/.}
|
||||
done
|
||||
|
||||
echo " < done - `date`"
|
||||
|
||||
# building
|
||||
echo
|
||||
|
@ -220,7 +237,7 @@ echo " > clapack"
|
|||
echo " - installing clapack"
|
||||
make lapack_install > "$TOOLS_LOG_PATH/clapack_2_install.log" 2>&1
|
||||
|
||||
cp -Rf INCLUDE "$INC_PATH/clapack"
|
||||
sudo cp -Rf INCLUDE "$INC_PATH/clapack"
|
||||
|
||||
echo " < done - `date`"
|
||||
echo
|
||||
|
@ -292,7 +309,7 @@ echo " > bundler"
|
|||
echo " - building bundler"
|
||||
make -j $CORES > "$TOOLS_LOG_PATH/bundler_2_build.log" 2>&1
|
||||
|
||||
cp -f "$BUNDLER_PATH/bin/Bundle2PMVS" "$BUNDLER_PATH/bin/Bundle2Vis" "$BUNDLER_PATH/bin/KeyMatchFull" "$BUNDLER_PATH/bin/bundler" "$BUNDLER_PATH/bin/RadialUndistort" "$TOOLS_BIN_PATH/"
|
||||
cp -f "$BUNDLER_PATH/bin/Bundle2PMVS" "$BUNDLER_PATH/bin/Bundle2Vis" "$BUNDLER_PATH/bin/KeyMatchFull" "$BUNDLER_PATH/bin/KeyMatch" "$BUNDLER_PATH/bin/bundler" "$BUNDLER_PATH/bin/RadialUndistort" "$TOOLS_BIN_PATH/"
|
||||
|
||||
cp -f "$BUNDLER_PATH/lib/libANN_char.so" "$TOOLS_LIB_PATH/"
|
||||
echo " < done - `date`"
|
||||
|
|
|
@ -39,7 +39,7 @@ my %objectStats = {
|
|||
minHeight => 0,
|
||||
maxWidth => 0,
|
||||
maxHeight => 0
|
||||
|
||||
|
||||
};
|
||||
|
||||
my %jobOptions = {
|
||||
|
@ -352,6 +352,8 @@ sub prepareObjects {
|
|||
$jobOptions{step_1_gzip} = "$jobOptions{jobDir}/_gzip.templist.txt";
|
||||
|
||||
$jobOptions{step_2_filelist} = "$jobOptions{jobDir}/_filelist.templist.txt";
|
||||
$jobOptions{step_2_macthes_jobs} = "$jobOptions{jobDir}/_matches_jobs.templist.txt";
|
||||
$jobOptions{step_2_matches_dir} = "$jobOptions{jobDir}/matches";
|
||||
$jobOptions{step_2_matches} = "$jobOptions{jobDir}/matches.init.txt";
|
||||
|
||||
$jobOptions{step_3_filelist} = "$jobOptions{jobDir}/list.txt";
|
||||
|
@ -381,16 +383,20 @@ sub resize {
|
|||
|
||||
foreach $fileObject (@objects) {
|
||||
if($fileObject->{isOk}){
|
||||
if($jobOptions{resizeTo} != "orig" && (($fileObject->{width} > $jobOptions{resizeTo}) || ($fileObject->{height} > $jobOptions{resizeTo}))){
|
||||
print "\n resising $fileObject->{src} \tto $fileObject->{step_0_resizedImage}";
|
||||
unless (-e "$fileObject->{step_0_resizedImage}"){
|
||||
if($jobOptions{resizeTo} != "orig" && (($fileObject->{width} > $jobOptions{resizeTo}) || ($fileObject->{height} > $jobOptions{resizeTo}))){
|
||||
print "\n resising $fileObject->{src} \tto $fileObject->{step_0_resizedImage}";
|
||||
|
||||
run("convert -resize $jobOptions{resizeTo}x$jobOptions{resizeTo} -quality 100 \"$jobOptions{srcDir}/$fileObject->{src}\" \"$fileObject->{step_0_resizedImage}\"");
|
||||
run("convert -resize $jobOptions{resizeTo}x$jobOptions{resizeTo} -quality 100 \"$jobOptions{srcDir}/$fileObject->{src}\" \"$fileObject->{step_0_resizedImage}\"");
|
||||
|
||||
} else {
|
||||
print "\n copying $fileObject->{src} \tto $fileObject->{step_0_resizedImage}";
|
||||
} else {
|
||||
print "\n copying $fileObject->{src} \tto $fileObject->{step_0_resizedImage}";
|
||||
|
||||
copy("$CURRENT_DIR/$fileObject->{src}", "$fileObject->{step_0_resizedImage}");
|
||||
}
|
||||
copy("$CURRENT_DIR/$fileObject->{src}", "$fileObject->{step_0_resizedImage}");
|
||||
}
|
||||
} else {
|
||||
print "\n using existing $fileObject->{src} \tto $fileObject->{step_0_resizedImage}";
|
||||
}
|
||||
|
||||
chomp($file_resolution = `jhead \"$fileObject->{step_0_resizedImage}\" | grep "Resolution"`);
|
||||
($fileObject->{width}, $fileObject->{height}) = $file_resolution =~ /: ([0-9]*) x ([0-9]*)/;
|
||||
|
@ -421,11 +427,15 @@ sub getKeypoints {
|
|||
$vlsiftJobs .= " && rm -f \"$fileObject->{step_1_pgmFile}\"";
|
||||
$vlsiftJobs .= " && rm -f \"$fileObject->{step_1_keyFile}.sift\"\n";
|
||||
} else {
|
||||
$vlsiftJobs .= "convert -format pgm \"$fileObject->{step_0_resizedImage}\" \"$fileObject->{step_1_pgmFile}\"";
|
||||
$vlsiftJobs .= " && \"$BIN_PATH/vlsift\" \"$fileObject->{step_1_pgmFile}\" -o \"$fileObject->{step_1_keyFile}.sift\" > /dev/null && perl \"$BIN_PATH/../convert_vlsift_to_lowesift.pl\" \"$jobOptions{jobDir}/$fileObject->{base}\"";
|
||||
$vlsiftJobs .= " && gzip -f \"$fileObject->{step_1_keyFile}\"";
|
||||
$vlsiftJobs .= " && rm -f \"$fileObject->{step_1_pgmFile}\"";
|
||||
$vlsiftJobs .= " && rm -f \"$fileObject->{step_1_keyFile}.sift\"\n";
|
||||
unless (-e "$jobOptions{jobDir}/$fileObject->{base}.key.bin") {
|
||||
$vlsiftJobs .= "convert -format pgm \"$fileObject->{step_0_resizedImage}\" \"$fileObject->{step_1_pgmFile}\"";
|
||||
$vlsiftJobs .= " && \"$BIN_PATH/vlsift\" \"$fileObject->{step_1_pgmFile}\" -o \"$fileObject->{step_1_keyFile}.sift\" > /dev/null && perl \"$BIN_PATH/../convert_vlsift_to_lowesift.pl\" \"$jobOptions{jobDir}/$fileObject->{base}\"";
|
||||
# $vlsiftJobs .= " && gzip -f \"$fileObject->{step_1_keyFile}\"";
|
||||
$vlsiftJobs .= " && rm -f \"$fileObject->{step_1_pgmFile}\"";
|
||||
$vlsiftJobs .= " && rm -f \"$fileObject->{step_1_keyFile}.sift\"\n";
|
||||
} else {
|
||||
print "using existing $jobOptions{jobDir}/$fileObject->{base}.key.bin\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -447,9 +457,30 @@ sub match {
|
|||
print "\n";
|
||||
|
||||
chdir($jobOptions{jobDir});
|
||||
mkdir($jobOptions{step_2_matches_dir});
|
||||
|
||||
$filesList = "";
|
||||
|
||||
$matchesJobs = "";
|
||||
|
||||
my $c = 0;
|
||||
my $t = ($objectStats{good}-1) * (($objectStats{good}-1) - ($objectStats{good}-1)%1)/2;
|
||||
|
||||
for (my $i = 0; $i < $objectStats{good}; $i++) {
|
||||
for (my $j = $i+1; $j < $objectStats{good}; $j++) {
|
||||
$c++;
|
||||
unless (-e "$jobOptions{step_2_matches_dir}/$i-$j.txt"){
|
||||
$matchesJobs .= "echo -n \" $c / $t\" && touch \"$jobOptions{step_2_matches_dir}/$i-$j.txt\" && \"$BIN_PATH/KeyMatch\" \"@objects[$i]->{step_1_keyFile}\" \"@objects[$j]->{step_1_keyFile}\" \"$jobOptions{step_2_matches_dir}/$i-$j.txt\"\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open (MATCH_DEST, ">$jobOptions{step_2_macthes_jobs}");
|
||||
print MATCH_DEST $matchesJobs;
|
||||
close(MATCH_DEST);
|
||||
|
||||
run("\"$BIN_PATH/parallel\" --halt-on-error 1 -j+0 < \"$jobOptions{step_2_macthes_jobs}\"");
|
||||
|
||||
return ;
|
||||
|
||||
foreach $fileObject (@objects) {
|
||||
if($fileObject->{isOk}){
|
||||
if($fileObject->{isOk}){
|
||||
|
@ -580,4 +611,4 @@ switch ($args{"--start-with"}) {
|
|||
|
||||
print "\n";
|
||||
print "\n - done - "; now(); print "\n";
|
||||
print "\n";
|
||||
print "\n";
|
Ładowanie…
Reference in New Issue