|
IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
|
OAK class to capture images and depth (there are no color images for this camera, only black and white) The depth images are aligned to the left camera by default class initialization. More...


Public Member Functions | |
| def | __init__ (self, configs=ConfigOak()) |
| constructor More... | |
| def | capture (self, bool normalization=True) |
| Gets RGBD frames in ImageRGBD() class format. More... | |
| def | get_frames (self, bool normalization=False, bool getBothMonoFrames=False, int scaleFactor=1) |
| Gets the next frame. More... | |
| def | getCameraIntrinsics (self) |
| Returns the intrinsic camera matrix and distortion coefficients return out camera intrinsic matrix, camera distortion coefficients. More... | |
| def | process_frame (self, theProcessor, figOut=False) |
| process a single frame More... | |
| def | process_frames_selected (self, theProcessor, bool figOut=True) |
| Replay and process data from the bag file attached to this instance. More... | |
| def | process_loop (self, theProcessor, bool figOut=False) |
| ill loop through indefinitely and send the obtained data to the passed function. More... | |
| def | start (self) |
| Start the capture stream. More... | |
| def | stop (self) |
| Stop the capture stream and release the device from use. More... | |
Public Member Functions inherited from Depth | |
| def | capture (self) |
| Alias for get_frames. More... | |
| def | display (self, frame, windowName='frame') |
| displays a frame More... | |
| def | get_configs (self) |
| returns the configs of the camera More... | |
| def | get_frames (self, bool normalization=False, int scaleFactor=1) |
| Gets the next frame. More... | |
| def | printConfigs (self) |
| Prints out the configurations in a more human readable way. More... | |
| def | set (self, cam, key, value) |
| Set a particular configuration. More... | |
| def | set_configs (self, configs) |
| sets all of the configs of the camera More... | |
Public Member Functions inherited from Base | |
| None | __init__ (self, configs, K=None) |
| Base class instantiator for camera runners. More... | |
| def | get (self, key) |
| def | get_frames (self) |
| def | readClicks (self) |
| Read the mouse clicks recorded on a window. More... | |
| def | registerMouseClicks (self, str windowName) |
| Register a window to record mouse clicks. More... | |
| def | set (self, key, value) |
| def | set_intrinsic (self, K) |
Public Attributes | |
| cameraMatrix | |
| camera intrinsic matrix More... | |
| depthQueue | |
| frame queue for the depth camera More... | |
| device | |
| device of the camera (dai.Device object) More... | |
| distortionCoeffs | |
| camera distortion coefficients More... | |
| K | |
| camera intrinsic matrix More... | |
| monoLeftQueue | |
| frame queue for the left mono camera More... | |
| monoLeftXLink | |
| link for left mono camera (dai.node.XlinkOut object) More... | |
| monoRightQueue | |
| frame queue for the right mono camera More... | |
| monoRightXLink | |
| link for right mono camera (dai.node.XlinkOut object) More... | |
| ready | |
| indicates if the camera is ready to stream images More... | |
| spatialCalcConfigInQueue | |
| queue for the config for the spatial calculator More... | |
| spatialCalcQueue | |
| queue for the spatial calculator More... | |
Public Attributes inherited from Depth | |
| calculationAlgorithm | |
| the calculation algorithm used for the spacital location calculator More... | |
| cameraMatrix | |
| camera intrinsic matrix More... | |
| depthCam | |
| depth camera node (dai.node.StereoDetph object) More... | |
| depthQueue | |
| frame queue for the depth camera More... | |
| depthXLink | |
| link for depth camera (dai.node.XLinkOut object) More... | |
| device | |
| the camera device (dai.Device object) More... | |
| distortionCoeffs | |
| camera distortion coefficients More... | |
| K | |
| camera intrinsic matrix More... | |
| monoLeftCam | |
| left mono camera node (dai.node.MonoCamera object) More... | |
| monoRightCam | |
| right mono camera node (dai.node.MonoCamera object) More... | |
| pipeline | |
| camera pipeline (dai.Pipeline object) More... | |
| ready | |
| indicates if the camera is ready to stream images More... | |
| spatialCalcConfigInQueue | |
| queue for the spatial calculator configuration More... | |
| spatialCalcConfigXLink | |
| link for spatial loocation calculator (dai.node.XLinkOut object) More... | |
| spatialCalcQueue | |
| queue for the spactial calculator More... | |
| spatialDataXLink | |
| link for spatial location data (dai.node.XLinkOut object) More... | |
| spatialLocationCalculator | |
| spatial location calculator node (dai.node.SpatialLocationCalculator object) More... | |
Public Attributes inherited from Base | |
| configs | |
| configuration dictionary for the camera More... | |
| K | |
| the camera's intrinsic matrix More... | |
| pts | |
| callback to append clicks to points list More... | |
OAK class to capture images and depth (there are no color images for this camera, only black and white) The depth images are aligned to the left camera by default class initialization.
OAK class to capture images and depth (there are no color images for this camera, only black and white) The depth images are aligned to the left camera by default class initialization
| def __init__ | ( | self, | |
configs = ConfigOak() |
|||
| ) |
| def capture | ( | self, | |
| bool | normalization = True |
||
| ) |
Gets RGBD frames in ImageRGBD() class format.
| [in] | normalization | if True, will normalize depth frame [0,255] for viewing. If False, depth frame is in meters |
Gets RGBD frames in ImageRGBD() class format.
Args:
normalization (bool):
- if True, the depth frame will be normalized to 0-255 for better visulaization
- if False, the depth frame will not be normalized and is returned in units of mm
| def get_frames | ( | self, | |
| bool | normalization = False, |
||
| bool | getBothMonoFrames = False, |
||
| int | scaleFactor = 1 |
||
| ) |
Gets the next frame.
| [in] | normalization | if True, will normalize depth frame [0,255] for viewing. If False, depth frame is in meters |
| [in] | getBothMonoFrames | if True, returns both left and right frames, False returns only left |
| [in] | scaleFactor | scaling factor on outputted frame |
Gets the next frame.
Args:
normalization (optional) :
- if True -> will normalize the depth frame [0,255]
- if False -> raw depth frame will be returned
getBothMonoFrames (optional) :
- if True -> will return both left and right image frames
- if False -> will only return the left image frame
scaleFactor (optional) : scaling factor on outputted frame
Returns:
- if getBothMonoFrames = True -> ((monoLeftFrame, monoRightFrame), depthFrame, True)
- if getBothMonoFrames = False -> (monoLeftFrame, depthFrame, True)
depth frame in units of [m] if not normalized
- if normalized, range will be from [0,255]
| def getCameraIntrinsics | ( | self | ) |
Returns the intrinsic camera matrix and distortion coefficients return out camera intrinsic matrix, camera distortion coefficients.
Returns the intrinsic camera matrix and distortion coefficients
Returns:
cameraMatrix:
distortionCoeffs :
(list (3,3)) intrinsice camera matrix distortionCoeffs
(list (,14)) distortion coefficients of the camera
Reimplemented from Depth.
| def process_frame | ( | self, | |
| theProcessor, | |||
figOut = False |
|||
| ) |
process a single frame
| [in] | theProcessor | RGBD stream data processor. Should handle input. |
| [in] | figOut | if True, show raw data. if False, do NOT show raw data |
Processes a single frame
Args:
theProcessor (any) :
- RGBD stream data processor. Should handle input.
figOut (optional) :
- true -> automatically show raw data
- false -> do NOT automatically show raw data
| def process_frames_selected | ( | self, | |
| theProcessor, | |||
| bool | figOut = True |
||
| ) |
Replay and process data from the bag file attached to this instance.
Will loop through the bag file and send obtained data to the passed function. The raw data can be visulaized if set, otherwise the processing function is responsible for handling output of raw, intermediate, or final data.
| [in] | theProcessor | RGBD stream data processor. Should handle input. |
| [in] | figOut | if True, show raw data. if False, do NOT show raw data |
Replay and process data from the bag file attached to this instance.
Will loop through the bag file and send obtained data to the passed function.
The raw data can be visulaized if set, otherwise the processing function is responsible
for handling output of raw, intermediate, or final data.
Args:
theProcessor (any) :
- RGBD stream data processor. Should handle input.
figOut (optional) :
- true -> automatically show raw data
- false -> do NOT automatically show raw data
| def process_loop | ( | self, | |
| theProcessor, | |||
| bool | figOut = False |
||
| ) |
ill loop through indefinitely and send the obtained data to the passed function.
The raw data can be visualized if set, otherwise the processing function is responsible for handling output of raw, intermediat, or final data
| [in] | theProcessor | RGBD stream data processor. Should handle input |
| [in] | figOut | if True, show raw data. if False, do NOT show raw data |
Will loop through indefinitely and send the obtained data to the passed function.
The raw data can be visualized if set, otherwise the processing function is
responsible for handling output of raw, intermediat, or final data
Args:
theProcessor (any) :
- RGBD stream data processor. Should handle input
figOut (optional) :
- true -> automatically show raw data
- false -> do NOT automatically show raw data
| def start | ( | self | ) |
Start the capture stream.
This must be called before get_frames() or capture()
Start the capture stream. This must be called before get_frames() or capture()
Reimplemented from Depth.
| def stop | ( | self | ) |
Stop the capture stream and release the device from use.
Stop the capture stream and release the device from use
Reimplemented from Depth.
| cameraMatrix |
camera intrinsic matrix
| depthQueue |
frame queue for the depth camera
| device |
device of the camera (dai.Device object)
| distortionCoeffs |
camera distortion coefficients
| K |
camera intrinsic matrix
| monoLeftQueue |
frame queue for the left mono camera
| monoLeftXLink |
link for left mono camera (dai.node.XlinkOut object)
| monoRightQueue |
frame queue for the right mono camera
| monoRightXLink |
link for right mono camera (dai.node.XlinkOut object)
| ready |
indicates if the camera is ready to stream images
| spatialCalcConfigInQueue |
queue for the config for the spatial calculator
| spatialCalcQueue |
queue for the spatial calculator