From b587afa89ec27ad934001b780643019481fcc13e Mon Sep 17 00:00:00 2001 From: Giovanni Di Grezia Date: Thu, 22 Sep 2016 20:28:56 +0200 Subject: [PATCH] added 3de to photoscan export script --- README.md | 2 + .../xg_export_photoscan.py | 184 ++++++++++++++++++ xg_export_photoscan.py | 184 ++++++++++++++++++ 3 files changed, 370 insertions(+) create mode 100644 single_versions_for_3de_online_db_scripts/xg_export_photoscan.py create mode 100644 xg_export_photoscan.py diff --git a/README.md b/README.md index 278257f..e8b541c 100644 --- a/README.md +++ b/README.md @@ -66,4 +66,6 @@ xg_restore_3d_calculated_points_exact.py - dependency: xg_store_restore_3d_point xg_store_3d_calculated_points.py - dependency: xg_store_restore_3d_points.py xg_store_restore_3d_points.py +xg_export_photoscan.py + ``` \ No newline at end of file diff --git a/single_versions_for_3de_online_db_scripts/xg_export_photoscan.py b/single_versions_for_3de_online_db_scripts/xg_export_photoscan.py new file mode 100644 index 0000000..3afc792 --- /dev/null +++ b/single_versions_for_3de_online_db_scripts/xg_export_photoscan.py @@ -0,0 +1,184 @@ +# +# +# 3DE4.script.name: Photoscan... +# +# 3DE4.script.version: v1.0 +# +# 3DE4.script.gui: Main Window::3DE4::Export Project +# +# 3DE4.script.comment: Creates a py script file that contains all project data, which can be imported into Photoscan to build Point Cloud. +# +# Giovanni Di Grezia 2016 +# http://www.xgiovio.com +# +# Some functions are from 3de export scripts + + +from vl_sdv import * + +def convertToAngles(r3d): + rot = rot3d(mat3d(r3d)).angles(VL_APPLY_ZXY) + rx = (rot[0]*180.0)/3.141592654 + ry = (rot[1]*180.0)/3.141592654 + rz = (rot[2]*180.0)/3.141592654 + return(rx,ry,rz) + +#maybe this function is not correct +def rot_matrix_for_photoscan (r3d): + rot3d_old = rot3d(mat3d(r3d)).angles(VL_APPLY_ZXY) + rot3d_new = rot3d(rot3d_old[1],rot3d_old[0],rot3d_old[2],VL_APPLY_ZXY) + return rot3d_new.mat() + + + +def prepareImagePath(path,startframe): + path = path.replace("\\","/") + i = 0 + n = 0 + i0 = -1 + while(i