Beispiel #1
0
from tools import las_to_o3d

"""
-- Mouse view control --
Left button + drag : Rotate.
Ctrl + left button + drag : Translate.
Wheel button + drag : Translate.
Shift + left button + drag : Roll.
Wheel : Zoom in/out.
-- Keyboard view control --
[/] : Increase/decrease field of view.
R : Reset view point.
Ctrl/Cmd + C : Copy current view status into the clipboard.
Ctrl/Cmd + V : Paste view status from clipboard.
-- General control --
Q, Esc : Exit window.
H : Print help message.
P, PrtScn : Take a screen capture.
D : Take a depth capture.
O : Take a capture of current rendering settings.
"""


# Visualize point cloud
def show_pcd(point_cloud, window_name='Window name'):
    o3d.visualization.draw_geometries_with_editing([point_cloud], window_name, width=1920, height=1080, left=50, top=50)


lo3d = las_to_o3d('data/01_las/chmura_dj.las')
show_pcd(lo3d)
Beispiel #2
0
            o3d.pipelines.registration.TransformationEstimationPointToPlane())
        print(reg_p2pl)
        print("Transformation matrix:")
        print(reg_p2pl.transformation)
        draw_registered_pcd(source, target, reg_p2pl.transformation)
        information_reg_p2pl = o3d.pipelines.registration.get_information_matrix_from_point_clouds(
            source, target, threshold, reg_p2pl.transformation)
        return reg_p2pl.transformation, information_reg_p2pl
    elif method == 'cicp':
        reg_cicp = o3d.pipelines.registration.registration_colored_icp(source, target, threshold, trans_init)
        print(reg_cicp)
        print("Transformation matrix:")
        print(reg_cicp.transformation)
        draw_registered_pcd(source, target, reg_cicp.transformation)
        information_reg_cicp = o3d.pipelines.registration.get_information_matrix_from_point_clouds(
            source, target, threshold, reg_cicp.transformation)
        return reg_cicp.transformation, information_reg_cicp
    else:
        print('The ICP method was incorrect')


if __name__ == '__main__':
    print('Starting app...')
    ref = las_to_o3d("data/01_las/chmura_dj.las")
    ori = las_to_o3d(
        "data/01_las/chmura_zdjecia_naziemne.las")
    trans_man = manual_target_based(ref, ori)
    ICP_registration(ref, ori, threshold=0.5, trans_init=trans_man, method='p2p')

    # ref.compute_point_cloud_distance()