easyidp.pix4d.parse_p4d_project#
- easyidp.pix4d.parse_p4d_project(project_path: str, param_folder=None)#
A fuction to automatically analyze related subfiles in pix4d project folder
- パラメータ:
project_path (str) --
the path to pix4d project file, that folder should contains the following sub-folder:
\project_path |--- 1_initial\ |--- 2_densification\ |___ 3_dsm_ortho\
- param_folder: str, default None
- if not given, it will parse as a standard pix4d project, and tryingto get the project name from
1_initial/param
folderif it is not a standard pix4d project (re-orgainzed folder), need manualspecify the path to param folder, in order to parse project_namefor later usage.
- 戻り値:
p4d -- a python dictionary that contains the path to each file.
{ "project_name": the prefix of whole project file. "param": the folder of parameters "pcd": the point cloud file "dom": the digital orthomosaic file "dsm": the digital surface model file "undist_raw": the undistorted images corrected by the pix4d software (when original image unable to find) }
- 戻り値の型:
dict
メモ
Project_name can be extracted from parameter folder prefix in easyidp 2.0, no need manual specify. To find the outputs, it will pick the first file that fits the expected file format.
サンプル
Data prepare
>>> import easyidp as idp >>> test_data = idp.data.TestData() >>> test_folder = test_data.pix4d.maize_folder PosixPath('/Users/<user>/Library/Application Support/easyidp.data/data_for_tests/pix4d/maize_tanashi/maize_tanashi_3NA_20190729_Ins1Rgb_30m_pix4d') >>> proj_name1 = "maize_tanashi_3NA_20190729_Ins1Rgb_30m_pix4d"
Then use this function to parse given pix4d:
>>> p4d_p = idp.pix4d.parse_p4d_project(test_folder) >>> p4d_p.keys() dict_keys(['param', 'pcd', 'dom', 'dsm', 'undist_raw', 'project_name']) >>> p4d_p['project_name'] 'maize_tanashi_3NA_20190729_Ins1Rgb_30m_pix4d' >>> p4d_p['dom'] PosixPath('/Users/<user>/Library/Application Support/easyidp.data/data_for_tests/pix4d/maize_tanashi/maize_tanashi_3NA_20190729_Ins1Rgb_30m_pix4d/3_dsm_ortho/2_mosaic/maize_tanashi_3NA_20190729_Ins1Rgb_30m_pix4d_transparent_mosaic_group1.tif')