Depth Sensing Module

Classes

class  RuntimeParameters
 Parameters that defines the behavior of the grab. More...
 
struct  CameraParameters
 Intrinsic parameters of a camera. More...
 
struct  CalibrationParameters
 Intrinsic and Extrinsic parameters of the camera (translation and rotation). More...
 

Enumerations

enum  DEPTH_MODE
 Lists available depth computation modes. More...
 
enum  SENSING_MODE
 Lists available depth sensing modes. More...
 
enum  MEASURE
 Lists retrievable measures. More...
 
enum  DEPTH_FORMAT
 Lists available file formats for saving depth maps. More...
 
enum  POINT_CLOUD_FORMAT
 Lists available file formats for saving point clouds. Stores the spatial coordinates (x,y,z) of each pixel and optionally its RGB color. More...
 

Functions

bool saveDepthAs (Camera &zed, DEPTH_FORMAT format, String name, float factor=1.)
 Writes the current depth map into a file. More...
 
bool saveDepthAs (Mat &depth, DEPTH_FORMAT format, String name, float factor=1.)
 Writes the current depth map into a file. More...
 
bool savePointCloudAs (Camera &zed, POINT_CLOUD_FORMAT format, String name, bool with_color=false)
 Writes the current point cloud into a file. More...
 
bool savePointCloudAs (Mat &cloud, POINT_CLOUD_FORMAT format, String name, bool with_color=false)
 Writes the current point cloud into a file. More...
 
String toString (const DEPTH_MODE &depthMode)
 Converts the given enumerated value into readable text. More...
 
String toString (const SENSING_MODE &sensingMode)
 Converts the given enumerated value into readable text. More...
 
String toString (const MEASURE &measure)
 Converts the given enumerated value into readable text. More...
 
String toString (const DEPTH_FORMAT &depth_frmt)
 Converts the given enumerated value into readable text. More...
 
String toString (const POINT_CLOUD_FORMAT &pc_frmt)
 Converts the given enumerated value into readable text. More...
 
DEPTH_MODE str2mode (String mode)
 Converts the given string into a DEPTH_MODE. More...
 
String depthMode2str (DEPTH_MODE mode)
 Converts the given DEPTH_MODE into a string. More...
 
String sensingMode2str (SENSING_MODE mode)
 Converts the given SENSING_MODE into a string. More...
 

Enumeration Type Documentation

◆ DEPTH_MODE

enum DEPTH_MODE

Lists available depth computation modes.

Enumerator
DEPTH_MODE_NONE 

This mode does not compute any depth map. Only rectified stereo images will be available.

DEPTH_MODE_PERFORMANCE 

Computation mode optimized for speed.

DEPTH_MODE_MEDIUM 

Balanced quality mode. Depth map is robust in any environment and requires medium resources for computation.

DEPTH_MODE_QUALITY 

Computation mode designed for high quality results.

DEPTH_MODE_ULTRA 

Computation mode favorising edges and sharpness. Requires more GPU memory and computation power.

DEPTH_MODE_LAST 

◆ SENSING_MODE

Lists available depth sensing modes.

Enumerator
SENSING_MODE_STANDARD 

This mode outputs ZED standard depth map that preserves edges and depth accuracy. Applications example: Obstacle detection, Automated navigation, People detection, 3D reconstruction, measurements.

SENSING_MODE_FILL 

This mode outputs a smooth and fully dense depth map. Applications example: AR/VR, Mixed-reality capture, Image post-processing.

SENSING_MODE_LAST 

◆ MEASURE

enum MEASURE

Lists retrievable measures.

Enumerator
MEASURE_DISPARITY 

Disparity map. Each pixel contains 1 float. sl::MAT_TYPE_32F_C1.

MEASURE_DEPTH 

Depth map. Each pixel contains 1 float. sl::MAT_TYPE_32F_C1.

MEASURE_CONFIDENCE 

Certainty/confidence of the depth map. Each pixel contains 1 float. sl::MAT_TYPE_32F_C1.

MEASURE_XYZ 

Point cloud. Each pixel contains 4 float (X, Y, Z, not used). sl::MAT_TYPE_32F_C4.

MEASURE_XYZRGBA 

Colored point cloud. Each pixel contains 4 float (X, Y, Z, color). The color need to be read as an usigned char[4] representing the RGBA color. sl::MAT_TYPE_32F_C4.

MEASURE_XYZBGRA 

Colored point cloud. Each pixel contains 4 float (X, Y, Z, color). The color need to be read as an usigned char[4] representing the BGRA color. sl::MAT_TYPE_32F_C4.

MEASURE_XYZARGB 

Colored point cloud. Each pixel contains 4 float (X, Y, Z, color). The color need to be read as an usigned char[4] representing the ARGB color. sl::MAT_TYPE_32F_C4.

MEASURE_XYZABGR 

Colored point cloud. Each pixel contains 4 float (X, Y, Z, color). The color need to be read as an usigned char[4] representing the ABGR color. sl::MAT_TYPE_32F_C4.

MEASURE_NORMALS 

Normals vector. Each pixel contains 4 float (X, Y, Z, 0). sl::MAT_TYPE_32F_C4.

MEASURE_DISPARITY_RIGHT 

Disparity map for right sensor. Each pixel contains 1 float. sl::MAT_TYPE_32F_C1.

MEASURE_DEPTH_RIGHT 

Depth map for right sensor. Each pixel contains 1 float. sl::MAT_TYPE_32F_C1.

MEASURE_XYZ_RIGHT 

Point cloud for right sensor. Each pixel contains 4 float (X, Y, Z, not used). sl::MAT_TYPE_32F_C4.

MEASURE_XYZRGBA_RIGHT 

Colored point cloud for right sensor. Each pixel contains 4 float (X, Y, Z, color). The color need to be read as an usigned char[4] representing the RGBA color. sl::MAT_TYPE_32F_C4.

MEASURE_XYZBGRA_RIGHT 

Colored point cloud for right sensor. Each pixel contains 4 float (X, Y, Z, color). The color need to be read as an usigned char[4] representing the BGRA color. sl::MAT_TYPE_32F_C4.

MEASURE_XYZARGB_RIGHT 

Colored point cloud for right sensor. Each pixel contains 4 float (X, Y, Z, color). The color need to be read as an usigned char[4] representing the ARGB color. sl::MAT_TYPE_32F_C4.

MEASURE_XYZABGR_RIGHT 

Colored point cloud for right sensor. Each pixel contains 4 float (X, Y, Z, color). The color need to be read as an usigned char[4] representing the ABGR color. sl::MAT_TYPE_32F_C4.

MEASURE_NORMALS_RIGHT 

Normals vector for right view. Each pixel contains 4 float (X, Y, Z, 0). sl::MAT_TYPE_32F_C4.

MEASURE_LAST 

◆ DEPTH_FORMAT

Lists available file formats for saving depth maps.

Enumerator
DEPTH_FORMAT_PNG 

PNG image format in 16bits. 32bits depth is mapped to 16bits color image to preserve the consistency of the data range.

DEPTH_FORMAT_PFM 

stream of bytes, graphic image file format.

DEPTH_FORMAT_PGM 

gray-scale image format.

DEPTH_FORMAT_LAST 

◆ POINT_CLOUD_FORMAT

Lists available file formats for saving point clouds. Stores the spatial coordinates (x,y,z) of each pixel and optionally its RGB color.

Enumerator
POINT_CLOUD_FORMAT_XYZ_ASCII 

Generic point cloud file format, without color information.

POINT_CLOUD_FORMAT_PCD_ASCII 

Point Cloud Data file, with color information.

POINT_CLOUD_FORMAT_PLY_ASCII 

PoLYgon file format, with color information.

POINT_CLOUD_FORMAT_VTK_ASCII 

Visualization ToolKit file, without color information.

POINT_CLOUD_FORMAT_LAST 

Function Documentation

◆ saveDepthAs() [1/2]

bool sl::saveDepthAs ( Camera zed,
DEPTH_FORMAT  format,
String  name,
float  factor = 1. 
)

Writes the current depth map into a file.

Parameters
zed: the current camera object.
format: the depth file format you desired.
name: the name (path) in which the depth will be saved.
factor: only for PNG and PGM, apply a gain to the depth value. default : 1. The PNG format only stores integers between 0 and 65536, if you're saving a depth map in meters, values will be rounded to the nearest integer. Set factor to 0.001 to reduce this effect by converting to millimeters. Do not forget to scale (by 1./factor) the pixel value at reading to get the real depth. The occlusions are represented by 0.
Returns
False if something wrong happens, else return true.

Referenced by Camera::isOpened().

◆ saveDepthAs() [2/2]

bool sl::saveDepthAs ( Mat depth,
DEPTH_FORMAT  format,
String  name,
float  factor = 1. 
)

Writes the current depth map into a file.

Parameters
depth: the depth map to record (CPU 32F_C1 Mat)
format: the depth file format you desired.
name: the name (path) in which the depth will be saved.
factor: only for PNG and PGM, apply a gain to the depth value. default : 1. The PNG format only stores integers between 0 and 65536, if you're saving a depth map in meters, values will be rounded to the nearest integer. Set factor to 0.001 to reduce this effect by converting to millimeters. Do not forget to scale (by 1./factor) the pixel value at reading to get the real depth. The occlusions are represented by 0.
Returns
False if something wrong happens, else return true.

◆ savePointCloudAs() [1/2]

bool sl::savePointCloudAs ( Camera zed,
POINT_CLOUD_FORMAT  format,
String  name,
bool  with_color = false 
)

Writes the current point cloud into a file.

Parameters
zed: the current camera object.
format: the point cloud file format you desired.
name: the name (path) in which the point cloud will be saved.
with_color: indicates if the color must be saved. default : false.
Returns
False if something wrong happens, else return true.
Note
The color is not saved for XYZ and VTK files.

Referenced by Camera::isOpened().

◆ savePointCloudAs() [2/2]

bool sl::savePointCloudAs ( Mat cloud,
POINT_CLOUD_FORMAT  format,
String  name,
bool  with_color = false 
)

Writes the current point cloud into a file.

Parameters
cloud: the point cloud to record (CPU 32F_C4 Mat)
format: the point cloud file format you desired.
name: the name (path) in which the point cloud will be saved.
with_color: indicates if the color must be saved. default : false.
Returns
False if something wrong happens, else return true.
Note
The color is not saved for XYZ and VTK files.

◆ toString() [1/5]

String sl::toString ( const DEPTH_MODE depthMode)

Converts the given enumerated value into readable text.

Returns
The enumerated value as a string.

◆ toString() [2/5]

String sl::toString ( const SENSING_MODE sensingMode)

Converts the given enumerated value into readable text.

Returns
The enumerated value as a string.

◆ toString() [3/5]

String sl::toString ( const MEASURE measure)

Converts the given enumerated value into readable text.

Returns
The enumerated value as a string.

◆ toString() [4/5]

String sl::toString ( const DEPTH_FORMAT depth_frmt)

Converts the given enumerated value into readable text.

Returns
The enumerated value as a string.

◆ toString() [5/5]

String sl::toString ( const POINT_CLOUD_FORMAT pc_frmt)

Converts the given enumerated value into readable text.

Returns
The enumerated value as a string.

◆ str2mode()

DEPTH_MODE sl::str2mode ( String  mode)

Converts the given string into a DEPTH_MODE.

Parameters
mode: a specific depth
Returns
The corresponding DEPTH_MODE

◆ depthMode2str()

String sl::depthMode2str ( DEPTH_MODE  mode)

Converts the given DEPTH_MODE into a string.

Parameters
mode: a specific DEPTH_MODE
Returns
The corresponding string
Deprecated:
See toString.

◆ sensingMode2str()

String sl::sensingMode2str ( SENSING_MODE  mode)

Converts the given SENSING_MODE into a string.

Parameters
mode: a specific SENSING_MODE
Returns
The corresponding string
Deprecated:
See toString.