stream.point_cloud

blickfeld_scanner.stream.point_cloud.signal_handler(sig, frame)
class blickfeld_scanner.stream.point_cloud.point_cloud(connection=None, from_file=None, filter=None, reference_frame=None, point_filter=None, algorithms=None, extend_subscribe_request=None, as_numpy=False)

Class to request a point cloud stream

Parameters
  • connection (blickfeld_scanner.scanner.connection) – connection to the device

  • from_file – path to file, of which to stream a point cloud, if this is set, no connection should be given

  • filter

    DEPRECATED

    > Introduced in BSL v2.10 and firmware v1.9

    Filter points and returns by point attributes during the post-processing on the device. Is replaced by ‘point_filter’.

  • reference_frame

    > Introduced in BSL v2.10 and firmware v1.9

    Frame representing the desired data. To request a field, set it to any value (also in submessages). For a repeated field, add at least one element.

  • point_filter

    > Introduced in BSL v2.10 and firmware v1.9

    Filter points and returns by point attributes during the post-processing on the device. This replaces the ‘filter’ parameter

  • algorithms

    > Introduced in BSL v2.17 and firmware v1.16

    Add set of algorithms which post-process the point cloud data.

  • extend_subscribe_request

    > Introduced in BSL v2.13 and firmware v1.13

    Extend point cloud subscription request with additional parameters. This is mainly used internally.

  • as_numpy

    > Introduced in BSL v2.16

    This enables numpy support of the point cloud stream. Use recv_frame_as_numpy() to fetch frames as numpy structured arrays. Specify the required attributes via the reference_frame attribute.

    Note: With devices with an firmware version older than v1.17, the performance is significantly worse than with up-to-date devices as the format needs to be converted on the client side. Consider updating the device.

REF_FRAME_XYZ = <Blickfeld Frame 0: 0 returns, 0.0x0.0 FoV, 1 scanlines>

Reference frame: XYZ coordinates

REF_FRAME_XYZ_I = <Blickfeld Frame 0: 0 returns, 0.0x0.0 FoV, 1 scanlines>

Reference frame: XYZ coordinates, intensity

REF_FRAME_XYZ_I_ID = <Blickfeld Frame 0: 0 returns, 0.0x0.0 FoV, 1 scanlines>

Reference frame: XYZ coordinates, intensity, frame id, scanline id, point id, return id

REF_FRAME_XYZ_I_ID_TS = <Blickfeld Frame 0: 0 returns, 0.0x0.0 FoV, 1 scanlines>

Reference frame: XYZ coordinates, intensity, frame id, scanline id, point id, return id, timestamps

REF_FRAME_DEPTH_MAP = <Blickfeld Frame 0: 0 returns, 0.0x0.0 FoV, 1 scanlines>

Reference frame: ambient_light_level, intensity, range, frame id, scanline id, point id

REF_FRAME_FULL = <Blickfeld Frame 0: 0 returns, 0.0x0.0 FoV, 1 scanlines>
REF_FRAME_PACKED = <Blickfeld Frame 0: 0 returns, 0.0x0.0 FoV, 1 scanlines>

Reference frame in packed (for Python: numpy) format: XYZ coordinates, direction, range, intensity, ambient_light_level, frame id, scanline id, point id, return id, timestamps

close()

Close point cloud stream and connection. Always call this function before deleting a point_cloud_stream object.

Deprecated since version 2.15.0: Since BSL v2.15.0 this function is deprecated, please use scanner.stream.point_cloud.point_cloud.stop to stop a stream.

get_metadata()

Get metadata of point cloud stream

Returns

Point cloud metadata, see: Protobuf definitions PointCloud.Metadata

recv_frame(fail_on_lost_frames=False)

Receive point cloud frame

Note: It is recommended to use recv_frame_as_numpy() with the ‘as_numpy=True’ attribute if numpy is available. Its performance is significantly better with up-to-date devices.

Parameters

fail_on_lost_frames – An exception will be raised when a frame is lost. Please check performance of client or network. If file recording is enabled the compressions level of gzip can be reduced and therefore less CPU power is needed. See record_to_file()

Returns

point cloud frame with all the data in it, see: Protobuf definitions Frame

recv_frame_as_numpy(fail_on_lost_frames=False)

Receive point cloud frame as numpy structured array.

Note: With devices with an firmware version older than v1.17, the performance is significantly worse than with up-to-date devices as the format needs to be converted on the client side. Consider updating the device.

Parameters

fail_on_lost_frames – An exception will be raised when a frame is lost. Please check performance of client or network. If file recording is enabled the compressions level of gzip can be reduced and therefore less CPU power is needed. See record_to_file()

Returns

point cloud frame as numpy structured array. The available fields depend on the reference_frame in the stream constructor or on the available fields in a recording.

end_of_stream()

Check whether stream has ended. This function is required for point cloud streams of files

Returns

Bool if end of stream is reached

record_to_file(file_name, compresslevel=1)

Record point cloud stream to file

Parameters
  • file_name – Path to the file where it should be dumped

  • compresslevel – The compresslevel argument is an integer from 0 to 9 controlling the level of compression; 1 is fastest and produces the least compression, and 9 is slowest and produces the most compression. 0 is no compression. The default is 1. If frames are lost during the recording decrease the compression level.

Deprecated since version 2.13.0: Since BSL v2.13.0 this function is deprecated, because of performance issues. Please use blickfeld_scanner.scanner.scanner.record_point_cloud_stream() for a performance improved recording.

stop_recording()

Stop recording. Always call this function or the blickfeld_scanner.stream.point_cloud.point_cloud.close() function before deleting a point_cloud object.

stop()

Unsubscribe of the point cloud stream and close connection. Always call this function before deleting a point_cloud_stream object.