data2D_path = '../data/data2D.ply' # Load clouds ref2D_cloud = read_ply(ref2D_path) data2D_cloud = read_ply(data2D_path) ref2D_cloud = np.asarray([np.asarray(list(x)) for x in ref2D_cloud]).T data2D_cloud = np.asarray([np.asarray(list(x)) for x in data2D_cloud]).T # Apply ICP data_aligned, R_list, T_list, neighbors_list, rms_list = icp_point_to_point( data2D_cloud, ref2D_cloud, 15, 1e-7) # Show ICP show_ICP(data2D_cloud, ref2D_cloud, R_list, T_list, neighbors_list) plt.plot(rms_list) plt.xlabel('iteration') plt.ylabel('RMSE') plt.show() # If statement to skip this part if wanted if False: # Cloud paths bunny_o_path = '../data/bunny_original.ply' bunny_p_path = '../data/bunny_perturbed.ply' # Load clouds bunny_o_cloud = read_ply(bunny_o_path)
# Load clouds ref2D_file = read_ply(ref2D_path) data2D_file = read_ply(data2D_path) ref2D_pts = np.vstack((ref2D_file['x'], ref2D_file['y'])) # data data2D_pts = np.vstack((data2D_file['x'], data2D_file['y'])) # ref # Apply ICP max_iter = 30 RMS_threshold = 0.06 data_aligned, R_list, T_list, neighbors_list, rms_list = icp_point_to_point( data2D_pts, ref2D_pts, max_iter, RMS_threshold) # Show ICP show_ICP(data2D_pts, ref2D_pts, R_list, T_list, neighbors_list) plt.style.use('seaborn') plt.plot(rms_list) plt.xlabel("iteration") plt.ylabel("RMS") plt.show() # If statement to skip this part if wanted if False: # Cloud paths bunny_o_path = '../data/bunny_original.ply' bunny_p_path = '../data/bunny_perturbed.ply' # Load clouds bunny_original_file = read_ply(bunny_o_path)
# # If statement to skip this part if wanted if False: # Load clouds ref2D_path = '../data/ref2D.ply' data2D_path = '../data/data2D.ply' ref2D_ply = read_ply(ref2D_path) data2D_ply = read_ply(data2D_path) ref2D = np.vstack((ref2D_ply['x'], ref2D_ply['y'])) data2D = np.vstack((data2D_ply['x'], data2D_ply['y'])) data2D_opt, R_list, T_list, neighbors_list, RMS_list = icp_point_to_point( data2D, ref2D, 10, 1e-4) show_ICP(data2D, ref2D, R_list, T_list, neighbors_list) # If statement to skip this part if wanted if False: # Load clouds bunny_o_path = '../data/bunny_original.ply' bunny_p_path = '../data/bunny_perturbed.ply' bunny_o_ply = read_ply(bunny_o_path) bunny_p_ply = read_ply(bunny_p_path) bunny_o = np.vstack( (bunny_o_ply['x'], bunny_o_ply['y'], bunny_o_ply['z'])) bunny_p = np.vstack( (bunny_p_ply['x'], bunny_p_ply['y'], bunny_p_ply['z'])) bunny_p_opt, R_list, T_list, neighbors_list, RMS_list = icp_point_to_point(
ref = read_ply(ref2D_path) ref = np.vstack((ref['x'], ref['y'])) data = read_ply(data2D_path) data = np.vstack((data['x'], data['y'])) # Apply ICP data_aligned, R_list, T_list, neighbors_list, RMS_list = icp_point_to_point( data, ref, 50, 1e-1) # Show ICP plt.plot(RMS_list) plt.title( "Evolution of the RMS between data and matched points of ref") plt.show() show_ICP(data, ref, R_list, T_list, neighbors_list) # If statement to skip this part if wanted if False: # Cloud paths bunny_o_path = '../data/bunny_original.ply' bunny_r_path = '../data/bunny_perturbed.ply' # Load point cloud ref = read_ply(bunny_o_path) ref = np.vstack((ref['x'], ref['y'], ref['z'])) data = read_ply(bunny_r_path) data = np.vstack((data['x'], data['y'], data['z'])) # Apply ICP
# Load clouds ref2D_file = read_ply(ref2D_path) data2D_file = read_ply(data2D_path) ref2D_pts = np.vstack((ref2D_file['x'], ref2D_file['y'])) # data data2D_pts = np.vstack((data2D_file['x'], data2D_file['y'])) # ref # Apply ICP max_iter = 30 RMS_threshold = 0.06 data_aligned, R_list, T_list, neighbors_list, rms_list = icp_point_to_point( data2D_pts, ref2D_pts, max_iter, RMS_threshold) # Show ICP #write_ply('../data2D_transform.ply', [data_aligned.T], ['x', 'y']) show_ICP(data2D_pts, ref2D_pts, R_list, T_list, neighbors_list) plot_rms(rms_list, "RMS on Data2D") # If statement to skip this part if wanted if False: # Cloud paths bunny_o_path = '../data/bunny_original.ply' bunny_p_path = '../data/bunny_perturbed.ply' # Load clouds bunny_o_file = read_ply(bunny_o_path) bunny_p_file = read_ply(bunny_p_path) bunny_o_pts = np.vstack( (bunny_o_file['x'], bunny_o_file['y'], bunny_o_file['z'])) # data
data2D_path = '../data/data2D.ply' # Load clouds # Load clouds ref = read_ply(ref2D_path) ref = np.vstack((ref['x'], ref['y'])) data = read_ply(data2D_path) data = np.vstack((data['x'], data['y'])) # Apply ICP data_aligned, R_list, T_list, neighbors_list, RMS_list = icp_point_to_point( data, ref, 20, 1e-6) # Show ICP show_ICP(data_aligned, ref, R_list, T_list, neighbors_list) # plot RMS plot_RMS(RMS_list) # If statement to skip this part if wanted if False: # Cloud paths bunny_o_path = '../data/bunny_original.ply' bunny_p_path = '../data/bunny_perturbed.ply' # Load clouds ref = read_ply(bunny_o_path) ref = np.vstack((ref['x'], ref['y'], ref['z']))