Developer Interface¶
Frame Module¶
- class TauLidarCommon.frame.Frame(_height, _width, _data_depth, _data_depth_rgb, _data_grayscale, _data_amplitude, _points_3d, _data)¶
3D Frame data including distance and grayscale.
- height¶
image height.
- width¶
image width.
- data_depth¶
depth map data, one dimensional array of float32. Example of converting to numpy array (opencv one channel Mat): mat_depth_map = np.frombuffer(frame.data_depth, dtype=np.float32, count=-1, offset=0).reshape(frame.height, frame.width)
- data_depth_rgb¶
depth color map data, three dimensional array of uint8. Example of converting to numpy array (opencv three channel Mat): mat_depth_rgb = np.frombuffer(frame.data_depth_rgb, dtype=np.uint16, count=-1, offset=0).reshape(frame.height, frame.width, 3) mat_depth_rgb = mat_depth_rgb.astype(np.uint8)
- data_grayscale¶
grayscale data, one dimensional array of uint8. Example of converting to numpy array (opencv one channel Mat): mat_grayscale = np.frombuffer(frame.data_grayscale, dtype=np.uint16, count=-1, offset=0).reshape(frame.height, frame.width) mat_grayscale = mat_grayscale.astype(np.uint8)
- data_amplitude¶
amplitude data, one dimensional array of uint16. Example of converting to numpy array (opencv one channel Mat): mat_amplitude = np.frombuffer(frame.data_amplitude, dtype=np.float32, count=-1, offset=0).reshape(frame.height, frame.width) mat_amplitude = mat_amplitude.astype(np.uint8)
- points_3d¶
3D points: list of unorganized 3D points. [X, Y, Z, R, G, B] XYZ: 3D coordinates in sensor coordinates reference system, unit is meter. RGB: pseudo RGB color values in a distance range based on smallest and largest Z values set by Camera.setRange(Z1, Z2).
- class TauLidarCommon.frame.FrameType(value)¶
FrameType Enum
Frame Builder Class¶
- class TauLidarCommon.d3.FrameBuilder¶
Helper class to build frame objects from raw bytestream camera output
- composeDistanceAmplitudeFrame(dataArray)¶
helper function: compose Frame using raw bytearray data
- composeDistanceFrame(dataArray)¶
helper function: compose Frame using raw bytearray data
- composeDistanceGrayscaleFrame(dataArray)¶
helper function: compose Frame using raw bytearray data
- composeFrame(dataArray, frameType)¶
compose Frame using raw bytearray data
- setColorMode(colorMode)¶
set the color mode of data to be processed
- setRange(z1, z2)¶
set 2D depth map color range
Image Colorizer Class¶
- class TauLidarCommon.d3.ImageColorizer¶
Helper class to color depth map.
- setRange(index) :
set distance range for coloring.
- getGrayscale(distance) :
get grayscale based on distance value.
- getColor(distance) :
get RGB color based on distance value.
- getColor(value)¶
get RGB color based on distance value.
- Parameters
value – distance value in minimeters.
- getGrayscale(value)¶
get grayscale based on distance value.
- Parameters
value – distance value in minimeters.
- setRange(start, stop)¶
set distance range for coloring.
- Parameters
start – starting distance.
stop – stopping distance.