IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
Public Member Functions | List of all members
RGBD Class Reference

Realsense SR 305 class to capture color images and depth. More...

Inheritance diagram for RGBD:
Inheritance graph
[legend]
Collaboration diagram for RGBD:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, str yamlInitFilePath=None)
 constructor More...
 
def capture (self, bool normalization=True)
 Gets RGBD frames in ImageRGBD() class format. More...
 
def get_frames (self, bool normalization=False)
 Gets the next frames. 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...
 
- Public Member Functions inherited from Depth
def capture (self)
 Alias for get_frames. More...
 
def display (self, np.ndarray frame, str windowName='frame')
 displays a frame More...
 
def get_configs (self)
 returns the configs of the camera More...
 
def getCameraIntrinsics (self)
 Returns the intrinsic camera matrix and distortion coefficients. More...
 
tuple getImagePixelWidthAndHeight (self)
 returns the width and height of the color image return out image width, image height More...
 
def printConfigs (self)
 Prints out the configurations in a more human readable way. More...
 
def set_configs (self, str yamlFilePath)
 sets all of the configs of the camera 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 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_configs (self, configs)
 
def set_intrinsic (self, K)
 

Additional Inherited Members

- Public Attributes inherited from Depth
 align
 alignment variable to align depth frames with color frames (rs.align object) More...
 
 cameraMatrix
 camera intrinsic matrix More...
 
 config
 configuration for a realsense camera (rs.config object) More...
 
 depthCameraMatrix
 intrinsic matrix for depth camera More...
 
 depthDistortionCoeffs
 distortion coefficients for depth camera More...
 
 depthScale
 scale factor to convert depth sensor units to meters More...
 
 distortionCoeffs
 distortion coefficients for the camera More...
 
 K
 camera intrinsic matrix More...
 
 pipeline
 camera pipeline (rs.pipeline object) More...
 
 ready
 indicates if the camera is ready to stream images 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...
 

Detailed Description

Realsense SR 305 class to capture color images and depth.

Realsense305 class to capture color images and depth

The depth images are aligned to the color camera

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
str  yamlInitFilePath = None 
)

constructor

Parameters
[in]yamlInitFilePathpath of yaml file to use for camera initialization
Realsense305 class to capture color images and depth
Args:
yamlInitFilePath (str):
    path of yaml file to use for camera initialization

Reimplemented from Depth.

Member Function Documentation

◆ capture()

def capture (   self,
bool  normalization = True 
)

Gets RGBD frames in ImageRGBD() class format.

Parameters
[in]normalizationif True, will normalize depth frame [0,255] for viewing. If False, depth frame is in meters return images ImageRGBD object with .color and .depth images populated
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 meters

◆ get_frames()

def get_frames (   self,
bool  normalization = False 
)

Gets the next frames.

Parameters
[in]normalizationif True, will normalize depth frame [0,255] for viewing. If False, depth frame is in meters
Returns
out colorFrame, depthFrame
Gets the next frame.
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 meters
Returns:
    (colorFrame, depthFrame):
        - colorFrame = color frame of camera
        - depthFrame = depth frame of camera

Reimplemented from Depth.

◆ process_frame()

def process_frame (   self,
  theProcessor,
  figOut = False 
)

process a single frame

Parameters
[in]theProcessorRGBD stream data processor. Should handle input.
[in]figOutif 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

◆ process_frames_selected()

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.

Parameters
[in]theProcessorRGBD stream data processor. Should handle input.
[in]figOutif 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

◆ process_loop()

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

Parameters
[in]theProcessorRGBD stream data processor. Should handle input
[in]figOutif 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

The documentation for this class was generated from the following file: