UTokyo-FieldPhenomics-Lab / EasyIDP

A handy tool for dealing with region of interest (ROI) on the image reconstruction (Metashape & Pix4D) outputs, mainly in agriculture applications
https://easyidp.readthedocs.io/en/latest/
MIT License
44 stars 6 forks source link

PointCloud class support conert to open3d #102

Open HowcanoeWang opened 1 year ago

HowcanoeWang commented 1 year ago

in some cases, need to use open3d for further processing

HowcanoeWang commented 1 year ago
def to_open3d(idp_pcd):
    final_pcd = o3d.geometry.PointCloud()
    final_pcd.points = o3d.utility.Vector3dVector(idp_pcd._points)
    color_np = idp_pcd.colors/255
    # color_np = np.insert(color_np, 2, 0.5, axis=1)
    # print(color_np)
    final_pcd.colors = o3d.utility.Vector3dVector(color_np)
    return final_pcd