diff options
author | bartus | 2017-04-03 11:06:28 +0200 |
---|---|---|
committer | bartus | 2017-04-03 11:10:59 +0200 |
commit | b240ce3d225da2027523d6a307db071450663efb (patch) | |
tree | 7a24652fd66898b0c92f8a873327ea82092a9ed6 | |
parent | 9eed5f232f4256970ff071f3aaf18c9ba7298203 (diff) | |
download | aur-b240ce3d225da2027523d6a307db071450663efb.tar.gz |
fix nvm export image path missing
add missin .SRCINFO
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 9 | ||||
-rw-r--r-- | nvm-export.patch | 67 |
3 files changed, 78 insertions, 2 deletions
@@ -1,6 +1,6 @@ pkgbase = colmap-git pkgdesc = COLMAP is a general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline with a graphical and command-line interface. - pkgver = 2.1.r95.g1c031a6 + pkgver = 2.1.r115.g7eceea5 pkgrel = 1 url = https://colmap.github.io/ install = colmap-git.install @@ -22,12 +22,14 @@ pkgbase = colmap-git depends = qt5-base optdepends = cuda: for cuda sfm/mvs acceleration source = colmap-git::git+https://github.com/colmap/colmap.git + source = nvm-export.patch source = colmap-git.install source = colmap.desktop source = vocabulary-tree-64K.bin::http://people.inf.ethz.ch/jschoenb/colmap/2.1/vocab_tree-65536.bin source = vocabulary-tree-256K.bin::http://people.inf.ethz.ch/jschoenb/colmap/2.1/vocab_tree-262144.bin source = vocabulary-tree-1M.bin::http://people.inf.ethz.ch/jschoenb/colmap/2.1/vocab_tree-1048576.bin md5sums = SKIP + md5sums = a59344b125e438a446f4ae1e747ea150 md5sums = ebb1dc43e014a1e720a06422c6248a40 md5sums = 55d81534d969cf706719007462f20443 md5sums = 3521ff3c601596473c6ce5256772f606 @@ -1,7 +1,7 @@ # Maintainer: bartus szczepaniak <aur@bartus.33mail.com> name=colmap pkgname=${name}-git -pkgver=2.1.r95.g1c031a6 +pkgver=2.1.r115.g7eceea5 pkgrel=1 pkgdesc="COLMAP is a general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline with a graphical and command-line interface." arch=('i686' 'x86_64') @@ -15,6 +15,7 @@ provides=() options=() install=${pkgname}.install source=("${pkgname}::git+https://github.com/colmap/colmap.git" + "nvm-export.patch" "${pkgname}.install" "${name}.desktop" "vocabulary-tree-64K.bin::http://people.inf.ethz.ch/jschoenb/colmap/2.1/vocab_tree-65536.bin" @@ -22,6 +23,7 @@ source=("${pkgname}::git+https://github.com/colmap/colmap.git" "vocabulary-tree-1M.bin::http://people.inf.ethz.ch/jschoenb/colmap/2.1/vocab_tree-1048576.bin" ) md5sums=('SKIP' + 'a59344b125e438a446f4ae1e747ea150' 'ebb1dc43e014a1e720a06422c6248a40' '55d81534d969cf706719007462f20443' '3521ff3c601596473c6ce5256772f606' @@ -33,6 +35,11 @@ pkgver() { git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' } +prepare() { + cd ${srcdir}/${pkgname} + patch -Np1 -i ../nvm-export.patch +} + build() { cd ${srcdir}/${pkgname} diff --git a/nvm-export.patch b/nvm-export.patch new file mode 100644 index 000000000000..eeecbf60deb1 --- /dev/null +++ b/nvm-export.patch @@ -0,0 +1,67 @@ +diff --git a/src/base/reconstruction.cc b/src/base/reconstruction.cc +index 87c96a0..efa65a6 100755 +--- a/src/base/reconstruction.cc ++++ b/src/base/reconstruction.cc +@@ -1033,7 +1033,7 @@ void Reconstruction::ImportPLY(const std::string& path) { + } + } + +-bool Reconstruction::ExportNVM(const std::string& path) const { ++bool Reconstruction::ExportNVM(const std::string& path, const std::string& image_path) const { + std::ofstream file(path.c_str(), std::ios::trunc); + CHECK(file.is_open()); + +@@ -1060,7 +1060,13 @@ bool Reconstruction::ExportNVM(const std::string& path) const { + -1 * camera.Params(SimpleRadialCameraModel::extra_params_idxs[0]); + const Eigen::Vector3d proj_center = image.ProjectionCenter(); + +- file << image.Name() << " "; ++ //fix white space in nvm path acordingly ++ std::string image_path_nvm = image_path ; ++ std::transform(image_path_nvm.begin(), image_path_nvm.end(), image_path_nvm.begin(), [](char ch) { ++ return ch == ' ' ? '"' : ch; ++ }); ++ ++ file << JoinPaths(image_path_nvm, image.Name()) << " "; + file << f << " "; + file << image.Qvec(0) << " "; + file << image.Qvec(1) << " "; +diff --git a/src/base/reconstruction.h b/src/base/reconstruction.h +index 4118509..3fd7e0b 100755 +--- a/src/base/reconstruction.h ++++ b/src/base/reconstruction.h +@@ -230,7 +230,7 @@ class Reconstruction { + void ImportPLY(const std::string& path); + + // Export to other data formats. +- bool ExportNVM(const std::string& path) const; ++ bool ExportNVM(const std::string& path,const std::string& image_path) const; + bool ExportBundler(const std::string& path, + const std::string& list_path) const; + void ExportPLY(const std::string& path) const; +diff --git a/src/exe/model_converter.cc b/src/exe/model_converter.cc +index 1328c24..8039c9a 100755 +--- a/src/exe/model_converter.cc ++++ b/src/exe/model_converter.cc +@@ -45,7 +45,7 @@ int main(int argc, char** argv) { + reconstruction.Read(input_path); + + if (output_type == "NVM") { +- reconstruction.ExportNVM(output_path); ++ reconstruction.ExportNVM(output_path,*options.image_path); + } else if (output_type == "Bundler") { + reconstruction.ExportBundler(output_path + ".bundle.out", + output_path + ".list.txt"); +diff --git a/src/ui/main_window.cc b/src/ui/main_window.cc +index ade5d4e..2b0f5da 100755 +--- a/src/ui/main_window.cc ++++ b/src/ui/main_window.cc +@@ -783,7 +783,7 @@ void MainWindow::ExportAs() { + const Reconstruction& reconstruction = + reconstruction_manager_.Get(SelectedReconstructionIdx()); + if (filter == "NVM (*.nvm)") { +- reconstruction.ExportNVM(path); ++ reconstruction.ExportNVM(path,*options_.image_path); + } else if (filter == "Bundler (*.out)") { + reconstruction.ExportBundler(path, path + ".list.txt"); + } else if (filter == "PLY (*.ply)") { |