viz¶
occulus.viz
¶
Visualization helpers using Open3D.
Optional module — requires pip install occulus[viz].
Available functions
- :func:
visualize— display one or more point clouds in an Open3D window - :func:
visualize_registration— overlay source and target with transform applied - :func:
visualize_segments— colorize a cloud by segment labels
All functions raise ImportError if Open3D is not installed.
visualize(*clouds, point_size=1.0, background=(0.1, 0.1, 0.1), window_name='Occulus Viewer', show_normals=False)
¶
Display one or more point clouds in an Open3D interactive viewer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*clouds
|
PointCloud
|
One or more point clouds to display simultaneously. |
()
|
point_size
|
float
|
Rendered point size in pixels, by default 1.0. |
1.0
|
background
|
tuple[float, float, float]
|
Background colour as (R, G, B) floats in [0, 1], by default (0.1, 0.1, 0.1). |
(0.1, 0.1, 0.1)
|
window_name
|
str
|
Title of the viewer window, by default |
'Occulus Viewer'
|
show_normals
|
bool
|
Whether to display normal vectors, by default |
False
|
Raises:
| Type | Description |
|---|---|
ImportError
|
If Open3D is not installed. |
ValueError
|
If no clouds are provided. |
Source code in src/occulus/viz/__init__.py
visualize_registration(source, target, result, *, source_color=(1.0, 0.2, 0.2), target_color=(0.2, 0.2, 1.0), window_name='Registration Result')
¶
Visualize a registration result with source and target overlaid.
The source cloud is rendered in source_color after applying the
registration transformation. The target remains in target_color.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
PointCloud
|
Source cloud (will be transformed for display). |
required |
target
|
PointCloud
|
Target cloud (fixed reference). |
required |
result
|
RegistrationResult
|
Registration result containing the 4×4 transformation matrix. |
required |
source_color
|
tuple[float, float, float]
|
RGB colour for transformed source points, by default red. |
(1.0, 0.2, 0.2)
|
target_color
|
tuple[float, float, float]
|
RGB colour for target points, by default blue. |
(0.2, 0.2, 1.0)
|
window_name
|
str
|
Viewer window title, by default |
'Registration Result'
|
Raises:
| Type | Description |
|---|---|
ImportError
|
If Open3D is not installed. |
Source code in src/occulus/viz/__init__.py
visualize_segments(cloud, labels, *, noise_color=(0.5, 0.5, 0.5), window_name='Segmentation Result')
¶
Visualize a segmented point cloud with each segment in a distinct colour.
Points with label -1 (noise) are rendered in noise_color.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cloud
|
PointCloud
|
Original point cloud. |
required |
labels
|
NDArray[int32]
|
Per-point segment labels of length |
required |
noise_color
|
tuple[float, float, float]
|
RGB colour for unassigned (noise) points, by default grey. |
(0.5, 0.5, 0.5)
|
window_name
|
str
|
Viewer window title, by default |
'Segmentation Result'
|
Raises:
| Type | Description |
|---|---|
ImportError
|
If Open3D is not installed. |
ValueError
|
If |