-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f965f4
commit d255a27
Showing
22 changed files
with
79,629 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import open3d as o3d | ||
import numpy as np | ||
|
||
if __name__ == "__main__": | ||
file_path = 'conferenceRoom_1.xyzrgb' | ||
pcd = o3d.io.read_point_cloud(file_path) | ||
vis = o3d.visualization.VisualizerWithEditing() | ||
# color bug fixing xyzrgb (float rgb?) | ||
if np.max(pcd.colors) > 1: | ||
pcd.colors = o3d.utility.Vector3dVector(np.asarray(pcd.colors)/255) | ||
pcd.points = o3d.utility.Vector3dVector( | ||
pcd.points - np.mean(pcd.points, axis=0, keepdims=True)) | ||
o3d.io.write_point_cloud("center.ply", pcd, write_ascii=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
8 | ||
0 0 0 | ||
1 0 0 | ||
1 1 0 | ||
0 1 0 | ||
0 0 1 | ||
1 0 1 | ||
1 1 1 | ||
0 1 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import open3d as o3d | ||
import numpy as np | ||
|
||
if __name__ == "__main__": | ||
file_path = 'conferenceRoom_1.xyzrgb' | ||
# norm_type = 'coord_max' | ||
norm_type = 'abs_max' | ||
pcd = o3d.io.read_point_cloud(file_path) | ||
vis = o3d.visualization.VisualizerWithEditing() | ||
# color bug fixing xyzrgb (float rgb?) | ||
if np.max(pcd.colors) > 1: | ||
pcd.colors = o3d.utility.Vector3dVector(np.asarray(pcd.colors)/255) | ||
points_min = np.min(pcd.points, axis=0) | ||
points_ptp = np.ptp(pcd.points, axis=0) # max - min | ||
print(points_min, points_ptp) | ||
if norm_type == 'coord_max': | ||
pcd.points = o3d.utility.Vector3dVector( | ||
(pcd.points - points_min) / points_ptp) | ||
else: | ||
pcd.points = o3d.utility.Vector3dVector( | ||
(pcd.points - points_min) / max(points_ptp)) | ||
print(np.min(pcd.points), np.max(pcd.points)) | ||
o3d.io.write_point_cloud("norm.ply", pcd, write_ascii=True) |
Oops, something went wrong.