helper_functions Namespace Reference

Functions

def calculate_rmsd (points1, points2, validPoints=None)

def convert_depth_frame_to_pointcloud (depth_image, camera_intrinsics)

def convert_depth_pixel_to_metric_coordinate (depth, pixel_x, pixel_y, camera_intrinsics)

def convert_pointcloud_to_depth (pointcloud, camera_intrinsics)

def cv_find_chessboard (depth_frame, infrared_frame, chessboard_params)

def get_boundary_corners_2D (points)

def get_chessboard_points_3D (chessboard_params)

def get_clipped_pointcloud (pointcloud, boundary)

def get_depth_at_pixel (depth_frame, pixel_x, pixel_y)

Function Documentation

 def helper_functions.calculate_rmsd ( points1, points2, validPoints = None )
calculates the root mean square deviation between to point sets

Parameters:
-------
points1, points2: numpy matrix (K, N)
where K is the dimension of the points and N is the number of points

validPoints: bool sequence of valid points in the point set.
If it is left out, all points are considered valid

Definition at line 21 of file helper_functions.py.

 def helper_functions.convert_depth_frame_to_pointcloud ( depth_image, camera_intrinsics )
Convert the depthmap to a 3D point cloud

Parameters:
-----------
depth_frame              : rs.frame()
The depth_frame containing the depth map
camera_intrinsics : The intrinsic values of the imager in whose coordinate system the depth_frame is computed

Return:
----------
x : array
The x values of the pointcloud in meters
y : array
The y values of the pointcloud in meters
z : array
The z values of the pointcloud in meters

Definition at line 151 of file helper_functions.py.

 def helper_functions.convert_depth_pixel_to_metric_coordinate ( depth, pixel_x, pixel_y, camera_intrinsics )
Convert the depth and image point information to metric coordinates

Parameters:
-----------
depth                    : double
The depth value of the image point
pixel_x                          : double
The x value of the image coordinate
pixel_y                          : double
The y value of the image coordinate
camera_intrinsics : The intrinsic values of the imager in whose coordinate system the depth_frame is computed

Return:
----------
X : double
The x value in meters
Y : double
The y value in meters
Z : double
The z value in meters

Definition at line 121 of file helper_functions.py.

 def helper_functions.convert_pointcloud_to_depth ( pointcloud, camera_intrinsics )
Convert the world coordinate to a 2D image coordinate

Parameters:
-----------
pointcloud               : numpy array with shape 3xN

camera_intrinsics : The intrinsic values of the imager in whose coordinate system the depth_frame is computed

Return:
----------
x : array
The x coordinate in image
y : array
The y coordiante in image

Definition at line 191 of file helper_functions.py.

 def helper_functions.cv_find_chessboard ( depth_frame, infrared_frame, chessboard_params )
Searches the chessboard corners using the set infrared image and the
checkerboard size

Returns:
-----------
chessboard_found : bool
Indicates wheather the operation was successful
corners          : array
(2,N) matrix with the image coordinates of the chessboard corners

Definition at line 73 of file helper_functions.py.

 def helper_functions.get_boundary_corners_2D ( points )
Get the minimum and maximum point from the array of points

Parameters:
-----------
points           : array
The array of points out of which the min and max X and Y points are needed

Return:
----------
boundary : array
The values arranged as [minX, maxX, minY, maxY]

Definition at line 225 of file helper_functions.py.

 def helper_functions.get_chessboard_points_3D ( chessboard_params )
Returns the 3d coordinates of the chessboard corners
in the coordinate system of the chessboard itself.

Returns
-------
objp : array
(3, N) matrix with N being the number of corners

Definition at line 54 of file helper_functions.py.

 def helper_functions.get_clipped_pointcloud ( pointcloud, boundary )
Get the clipped pointcloud withing the X and Y bounds specified in the boundary

Parameters:
-----------
pointcloud               : array
The input pointcloud which needs to be clipped
boundary      : array
The X and Y bounds

Return:
----------
pointcloud : array
The clipped pointcloud

Definition at line 257 of file helper_functions.py.

 def helper_functions.get_depth_at_pixel ( depth_frame, pixel_x, pixel_y )
Get the depth value at the desired image point

Parameters:
-----------
depth_frame      : rs.frame()
The depth frame containing the depth information of the image coordinate
pixel_x                          : double
The x value of the image coordinate
pixel_y                          : double
The y value of the image coordinate

Return:
----------
depth value at the desired pixel

Definition at line 99 of file helper_functions.py.

librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:36