-
Notifications
You must be signed in to change notification settings - Fork 2
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
78aacc8
commit bd92be8
Showing
6 changed files
with
390 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
airo_camera_toolkit/image_transforms/tutorial_image.jpg | ||
airo_camera_toolkit/calibration/saved_calibrations | ||
**/calibration_20**/ | ||
notebooks/data |
16 changes: 16 additions & 0 deletions
16
airo-camera-toolkit/airo_camera_toolkit/point_clouds/conversions.py
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,16 @@ | ||
import numpy as np | ||
import open3d as o3d | ||
from airo_typing import ColoredPointCloudType | ||
|
||
|
||
def pointcloud_open3d_to_numpy(pcd: o3d.geometry.PointCloud) -> ColoredPointCloudType: | ||
points = np.asarray(pcd.points).astype(np.float32) | ||
colors = (np.asarray(pcd.colors) * 255).astype(np.uint8) | ||
return points, colors | ||
|
||
|
||
def pointcloud_numpy_to_open3d(pointcloud: ColoredPointCloudType) -> o3d.geometry.PointCloud: | ||
pcd = o3d.geometry.PointCloud() | ||
pcd.points = o3d.utility.Vector3dVector(pointcloud[0].astype(np.float64)) | ||
pcd.colors = o3d.utility.Vector3dVector(pointcloud[1].astype(np.float64) / 255) | ||
return pcd |
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
Oops, something went wrong.