pixano.core.depth_image
DepthImage(depth_map=None, bytes=None, shape=None)
Bases: PixanoType
, BaseModel
Depth image type
Attributes:
Name | Type | Description |
---|---|---|
_depth_map |
ndarray
|
Depth image as NumPy array |
_bytes |
bytes
|
Depth image as bytes |
_shape |
list[int]
|
Depth image shape |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
depth_map
|
ndarray
|
Depth image as NumPy array. Defaults to None. |
None
|
bytes
|
bytes
|
Depth image as bytes. Defaults to None. |
None
|
shape
|
list[int]
|
Depth image shape. Defaults to None. |
None
|
Source code in pixano/core/depth_image.py
bytes: bytes
property
depth_map: np.ndarray
property
shape: list[int]
property
display()
Display Depth image with matplotlib
Returns:
Type | Description |
---|---|
Figure
|
Plotted image |
Source code in pixano/core/depth_image.py
load(path)
staticmethod
Create depth image from 16-bit .png file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
Path of .png file of depth image |
required |
Returns:
Type | Description |
---|---|
DepthImage
|
Depth image |
Source code in pixano/core/depth_image.py
load_npy(path)
staticmethod
Create depth image from .npy file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
Path to .npy file containing depth image as NumPy Array. |
required |
Returns:
Type | Description |
---|---|
DepthImage
|
Depth image |
Source code in pixano/core/depth_image.py
open()
save(path)
Save depth image to .png file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
Path to .png file to save |
required |
to_grayscale()
Transform Depth image to 8-bit grayscale depth image
Returns:
Type | Description |
---|---|
DepthImage
|
8-bit grayscale depth image |
Source code in pixano/core/depth_image.py
to_struct()
staticmethod
Return DepthImage type as PyArrow Struct
Returns:
Type | Description |
---|---|
StructType
|
Custom type corresponding PyArrow Struct |