2015-11-17 12:38:56 +00:00
|
|
|
import os
|
2015-11-19 12:00:34 +00:00
|
|
|
import sys
|
2015-11-27 10:00:43 +00:00
|
|
|
import multiprocessing
|
2015-11-17 12:38:56 +00:00
|
|
|
|
2015-11-18 16:37:41 +00:00
|
|
|
# Define some needed locations
|
2019-05-06 19:42:49 +00:00
|
|
|
current_path = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
root_path, _ = os.path.split(current_path)
|
2015-11-18 16:37:41 +00:00
|
|
|
|
|
|
|
superbuild_path = os.path.join(root_path, 'SuperBuild')
|
2017-06-29 14:55:43 +00:00
|
|
|
superbuild_bin_path = os.path.join(superbuild_path, 'install', 'bin')
|
2015-11-17 12:38:56 +00:00
|
|
|
|
2020-09-08 17:08:57 +00:00
|
|
|
# add opencv,opensfm to python path
|
2020-09-09 17:23:53 +00:00
|
|
|
python_packages_paths = [os.path.join(superbuild_path, p) for p in [
|
2021-09-02 22:12:18 +00:00
|
|
|
'install/lib/python3.9/dist-packages',
|
2020-11-06 20:13:51 +00:00
|
|
|
'install/lib/python3.8/dist-packages',
|
2020-09-09 17:23:53 +00:00
|
|
|
'install/lib/python3/dist-packages',
|
2021-04-29 19:12:09 +00:00
|
|
|
'install/bin/opensfm'
|
2020-09-09 17:23:53 +00:00
|
|
|
]]
|
|
|
|
for p in python_packages_paths:
|
|
|
|
sys.path.append(p)
|
2020-09-08 17:08:57 +00:00
|
|
|
|
2015-11-17 13:59:41 +00:00
|
|
|
|
2015-11-30 15:49:52 +00:00
|
|
|
# define opensfm path
|
2021-04-29 19:12:09 +00:00
|
|
|
opensfm_path = os.path.join(superbuild_bin_path, "opensfm")
|
2015-11-18 16:37:41 +00:00
|
|
|
|
2021-04-27 19:55:14 +00:00
|
|
|
poisson_recon_path = os.path.join(superbuild_bin_path, 'PoissonRecon')
|
2021-04-27 15:43:51 +00:00
|
|
|
dem2mesh_path = os.path.join(superbuild_bin_path, 'dem2mesh')
|
2021-04-27 18:53:49 +00:00
|
|
|
dem2points_path = os.path.join(superbuild_bin_path, 'dem2points')
|
2018-10-28 23:57:08 +00:00
|
|
|
|
2016-03-24 17:35:29 +00:00
|
|
|
# define mvstex path
|
2021-04-27 15:43:51 +00:00
|
|
|
mvstex_path = os.path.join(superbuild_bin_path, "texrecon")
|
2016-03-24 17:35:29 +00:00
|
|
|
|
2020-10-27 21:10:10 +00:00
|
|
|
# openmvs paths
|
2021-04-27 15:43:51 +00:00
|
|
|
omvs_densify_path = os.path.join(superbuild_bin_path, "OpenMVS", "DensifyPointCloud")
|
|
|
|
omvs_reconstructmesh_path = os.path.join(superbuild_bin_path, "OpenMVS", "ReconstructMesh")
|
2020-10-27 21:10:10 +00:00
|
|
|
|
2021-12-07 16:59:30 +00:00
|
|
|
fpcfilter_path = os.path.join(superbuild_bin_path, "FPCFilter")
|
|
|
|
|
2021-04-28 18:58:19 +00:00
|
|
|
odm_orthophoto_path = os.path.join(superbuild_bin_path, "odm_orthophoto")
|
2017-02-09 17:55:45 +00:00
|
|
|
settings_path = os.path.join(root_path, 'settings.yaml')
|
|
|
|
|
2015-11-17 13:59:41 +00:00
|
|
|
# Define supported image extensions
|
2020-09-16 13:56:07 +00:00
|
|
|
supported_extensions = {'.jpg','.jpeg','.png', '.tif', '.tiff', '.bmp'}
|
2015-11-27 10:00:43 +00:00
|
|
|
|
2018-06-27 18:32:49 +00:00
|
|
|
# Define the number of cores
|
2015-12-11 21:24:52 +00:00
|
|
|
num_cores = multiprocessing.cpu_count()
|
2020-09-09 19:24:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Print python paths if invoked as a script
|
|
|
|
if __name__ == "__main__":
|
|
|
|
print("export PYTHONPATH=" + ":".join(python_packages_paths))
|