I have two numpy array “point” and “r”. These array contains coordinates of point cloud [[x y z]]. Now i need to remove the values of “r” from “point”. I cannot do a for loop because i have thousands of coordinates and this take a lot of time. I tried using the numpy isin method but the problem it seems is that it also remove values where only one of the three dimension match inside the array. I need to remove point where all the x y z matches in both array.
There is no problem in the “r” array. if i just save the “r” array i get all the point that should be inside “r” but when i run this np.isin method then point that should not be remove also gets removed.
r = np.array([[x y z]])
point = np.vstack((las.x, las.y, las.z)).transpose()
non_building_mask = ~np.isin(point, r).all(axis=1)
sampled_points = point[non_building_mask]
new_file = laspy.create(point_format=las.header.point_format, file_version=las.header.version)
new_file.x, new_file.y, new_file.z = sampled_points.T