easyidp.pix4d.read_campos_geo#

easyidp.pix4d.read_campos_geo(campos_path)#

Read *_calibrated_images_position.txt for easyidp.reconstruct.Photo.position (geo_location)

Parameters:

campos_path (str) – file path

Returns:

campos_dict = {
    "Image1.JPG": np.array([x, y ,z]),
    "Image2.JPG": ...
    ...
}

Return type:

dict

Notes

this file contains the geo position of each camera, and looks like:

DJI_0954.JPG,368030.548722,3955824.412658,127.857028
DJI_0955.JPG,368031.004387,3955824.824967,127.381322
DJI_0956.JPG,368033.252520,3955826.479610,127.080709
DJI_0957.JPG,368032.022104,3955826.060493,126.715974
DJI_0958.JPG,368031.901165,3955826.109158,126.666393
DJI_0959.JPG,368030.686490,3955830.981070,127.327741

Example

Data prepare

>>> import numpy as np
>>> np.set_printoptions(suppress=True)

>>> import easyidp as idp
>>> test_data = idp.data.TestData()

>>> param_folder = str(test_data.pix4d.maize_folder / "1_initial" / "params")
>>> param = idp.pix4d.parse_p4d_param_folder(param_folder)

Then use this function:

>>> idp.pix4d.read_campos_geo(param['campos'])
{
    'DJI_0954.JPG':
        array([ 368030.548722, 3955824.412658,     127.857028]),

    'DJI_0955.JPG':
        array([ 368031.004387, 3955824.824967,     127.381322]),

    ...
}