Skip to content

Commit

Permalink
[OpenMVS] fix tool paths
Browse files Browse the repository at this point in the history
  • Loading branch information
cenit committed Jul 3, 2020
1 parent 557f145 commit 4ed4059
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ports/openmvs/CONTROL
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: openmvs
Version: 1.1-2
Description: OpenMVS: open Multi-View Stereo reconstruction library
Homepage: https://cdcseacave.github.io/openMVS
Build-Depends: zlib, boost-iostreams, boost-program-options, boost-system, boost-serialization, eigen3, ceres, opencv, cgal[core], glew, glfw3, vcglib
Build-Depends: zlib, boost-iostreams, boost-program-options, boost-system, boost-serialization, eigen3, ceres, opencv, cgal[core], glew, glfw3, vcglib, openmvg[software]

Feature: cuda
Build-Depends: cuda
Expand Down
37 changes: 37 additions & 0 deletions ports/openmvs/fix-tool-paths.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/MvgMvsPipeline.py b/MvgMvsPipeline.py.in
similarity index 97%
rename from MvgMvsPipeline.py
rename to MvgMvsPipeline.py.in
index f4914bf..6ecc060 100644
--- a/MvgMvsPipeline.py
+++ b/MvgMvsPipeline.py.in
@@ -91,12 +91,12 @@ def find(afile):
return None

# Try to find openMVG and openMVS binaries in PATH
-OPENMVG_BIN = whereis("openMVG_main_SfMInit_ImageListing")
-OPENMVS_BIN = whereis("ReconstructMesh")
+OPENMVG_BIN = "@OPENMVG_TOOLS_PATH@"
+OPENMVS_BIN = "@OPENMVS_TOOLS_PATH@"

# Try to find openMVG camera sensor database
-CAMERA_SENSOR_DB_FILE = "sensor_width_camera_database.txt"
-CAMERA_SENSOR_DB_DIRECTORY = find(CAMERA_SENSOR_DB_FILE)
+CAMERA_SENSOR_DB_FILE = "@SENSOR_WIDTH_CAMERA_DATABASE_TXT_PATH@"
+CAMERA_SENSOR_DB_DIRECTORY = "@OPENMVG_TOOLS_PATH@"

# Ask user for openMVG and openMVS directories if not found
if not OPENMVG_BIN:
@@ -175,10 +175,10 @@ class StepsStore:
["-i", "%input_dir%", "-o", "%matches_dir%", "-d", "%camera_file_params%"]],
["Compute features", # 1
os.path.join(OPENMVG_BIN, "openMVG_main_ComputeFeatures"),
- ["-i", "%matches_dir%/sfm_data.json", "-o", "%matches_dir%", "-m", "SIFT", "-n", "4"]],
+ ["-i", "%matches_dir%/sfm_data.json", "-o", "%matches_dir%", "-m", "SIFT"]],
["Compute matches", # 2
os.path.join(OPENMVG_BIN, "openMVG_main_ComputeMatches"),
- ["-i", "%matches_dir%/sfm_data.json", "-o", "%matches_dir%", "-n", "HNSWL2", "-r", ".8"]],
+ ["-i", "%matches_dir%/sfm_data.json", "-o", "%matches_dir%", "-n", "AUTO", "-r", ".8"]],
["Incremental reconstruction", # 3
os.path.join(OPENMVG_BIN, "openMVG_main_IncrementalSfM"),
["-i", "%matches_dir%/sfm_data.json", "-m", "%matches_dir%", "-o", "%reconstruction_dir%"]],
7 changes: 7 additions & 0 deletions ports/openmvs/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ vcpkg_from_github(
REF v1.1
SHA512 baa9149853dc08c602deeb1a04cf57643d1cb0733aee2776f4e99b210279aad3b4a1013ab1d790e91a3a95b7c72b9c12c6be25f2c30a76b69b5319b610cb8e7a
HEAD_REF master
PATCHES
fix-tool-paths.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down Expand Up @@ -38,4 +40,9 @@ vcpkg_copy_tools(AUTO_CLEAN TOOL_NAMES
Viewer
)

set(OPENMVG_TOOLS_PATH "${CURRENT_INSTALLED_DIR}/tools/openmvg")
set(OPENMVS_TOOLS_PATH "${CURRENT_INSTALLED_DIR}/tools/${PORT}")
set(SENSOR_WIDTH_CAMERA_DATABASE_TXT_PATH "${OPENMVG_TOOLS_PATH}/sensor_width_camera_database.txt")
configure_file("${SOURCE_PATH}/MvgMvsPipeline.py.in" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/MvgMvsPipeline.py" @ONLY)

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

0 comments on commit 4ed4059

Please sign in to comment.