diff --git a/ports/openmvs/CONTROL b/ports/openmvs/CONTROL index 2006a514c9e83f..368c0b23514c38 100644 --- a/ports/openmvs/CONTROL +++ b/ports/openmvs/CONTROL @@ -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 diff --git a/ports/openmvs/fix-tool-paths.patch b/ports/openmvs/fix-tool-paths.patch new file mode 100644 index 00000000000000..64ff02fe11f425 --- /dev/null +++ b/ports/openmvs/fix-tool-paths.patch @@ -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%"]], diff --git a/ports/openmvs/portfile.cmake b/ports/openmvs/portfile.cmake index 653c97ed462521..7f6dc67bd5fd41 100644 --- a/ports/openmvs/portfile.cmake +++ b/ports/openmvs/portfile.cmake @@ -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 @@ -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)