diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index a828abc..84643d2 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -13,6 +13,15 @@ influence the resulting point cloud. ### Removed +## [2.16.1] - 2021.01.26 + +### Added +* Python: Structured numpy interface flag is now available for file streams + +### Changed +* Bugfix: Do not enforce the legacy serial number for hardware modules +* API: Rename filter `points_with_no_returns` to `delete_points_without_returns` + ## [2.16.0] - 2020.12.16 ### Added diff --git a/doc/protobuf-frame-visualisation.png b/doc/protobuf-frame-visualisation.png index 51edda2..70f278b 100644 Binary files a/doc/protobuf-frame-visualisation.png and b/doc/protobuf-frame-visualisation.png differ diff --git a/doc/protobuf_protocol.md b/doc/protobuf_protocol.md index 0049fdf..f6cbb0f 100644 --- a/doc/protobuf_protocol.md +++ b/doc/protobuf_protocol.md @@ -1637,7 +1637,7 @@ This can be used to e.g. filter points with low intensity or to enable secondary | ambient_light_level | [blickfeld.protocol.OptionalValueRange](#blickfeld.protocol.OptionalValueRange) | optional | Filter all points, which ambient light level values are not within this value range. | | range | [blickfeld.protocol.OptionalValueRange](#blickfeld.protocol.OptionalValueRange) | optional | Filter all points, which range values are not within this value range. | | noise | [ScanPattern.Filter.Noise](#blickfeld.protocol.config.ScanPattern.Filter.Noise) | optional |
Introduced in BSL v2.11 and firmware v1.11
Refer to [Filter.Noise](#blickfeld.protocol.config.ScanPattern.Filter.Noise) | -| points_with_no_returns | [bool](#bool) | optional |
Introduced in BSL v2.16 and firmware v1.17
+| delete_points_without_returns | [bool](#bool) | optional |
Introduced in BSL v2.16 and firmware v1.17
All points without any returns are filtered if this setting is true. With active algorithms, such as background subtraction, this can reduce the bandwidth significantly. diff --git a/examples/python/numpy_frame.py b/examples/python/numpy_frame.py index 89cf6df..8b7172c 100644 --- a/examples/python/numpy_frame.py +++ b/examples/python/numpy_frame.py @@ -25,9 +25,11 @@ def fetch_numpy_frame(target): # Create filter to filter points and returns by point attributes during the post-processing on the device. point_filter = scan_pattern_pb2.ScanPattern().Filter() point_filter.max_number_of_returns_per_point = 2 # Set max number of returns to 2. The default value is 1. - point_filter.points_with_no_returns = True # Filter points with no returns. This reduces the dataset only to valid returns. + point_filter.delete_points_without_returns = True # Filter points with no returns. This reduces the dataset only to valid returns. - stream = device.get_point_cloud_stream(point_filter=point_filter, as_numpy=True) # Create a point cloud stream object + # Create a point cloud stream object + # The `as_numpy` flag enables the numpy support. + stream = device.get_point_cloud_stream(point_filter=point_filter, as_numpy=True) for i in range(10): frame, data = stream.recv_frame_as_numpy() diff --git a/protocol/blickfeld/common.proto b/protocol/blickfeld/common.proto index 6d1a2f3..01ede24 100644 --- a/protocol/blickfeld/common.proto +++ b/protocol/blickfeld/common.proto @@ -28,7 +28,7 @@ message SoftwareVersion { message HardwareModule { optional string serial_number = 1 [(optional)=true, (regex) = "[A-Z2-7]{9}", (legacy_field_id)=2]; // Serial number of the hardware module - optional string legacy_serial_number = 2 [ deprecated=true ]; // Deprecated legacy serial number format + optional string legacy_serial_number = 2 [ deprecated=true, (optional)=true ]; // Deprecated legacy serial number format optional string version = 3 [(optional)=true, (regex)="v[0-9]+\\.[0-9]+\\.[0-9]+"]; // Hardware version of the hardware module if available. } diff --git a/protocol/blickfeld/config/scan_pattern.proto b/protocol/blickfeld/config/scan_pattern.proto index 311ae1e..d3215e2 100644 --- a/protocol/blickfeld/config/scan_pattern.proto +++ b/protocol/blickfeld/config/scan_pattern.proto @@ -255,7 +255,7 @@ message ScanPattern { * In scenarios, where from one frame to another, all points have returns (e.g. due to environmental changes), * the peak bandwidths might increase significantly. This could result, in these scenarios, in frame losses. */ - optional bool points_with_no_returns = 6 [ default = false ]; + optional bool delete_points_without_returns = 6 [ default = false ]; } optional Horizontal horizontal = 1; // Refer to [ScanPattern.Horizontal](#blickfeld.protocol.config.ScanPattern.Horizontal) diff --git a/python/blickfeld_scanner/scanner.py b/python/blickfeld_scanner/scanner.py index 6c8d767..6a15972 100644 --- a/python/blickfeld_scanner/scanner.py +++ b/python/blickfeld_scanner/scanner.py @@ -212,14 +212,21 @@ def record_point_cloud_stream(self, file_name, point_filter=None, reference_fram return stream.raw(self.create_connection(), req, file_name) @staticmethod - def file_point_cloud_stream(dump_filename): + def file_point_cloud_stream(dump_filename, as_numpy=False): """ Request a point_cloud_stream, which streams off a .bfpc file. No device (and connection to a device) is needed for this operation. :param dump_filename: path to .bfpc file + :param 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: The performance of this option is significantly better with files that were recorded in the packed format. Packed recordings are available in firmware versions >= v1.17. :return: :py:class:`blickfeld_scanner.scanner.stream.point_cloud` object """ - return stream.point_cloud(from_file=dump_filename) + return stream.point_cloud(from_file=dump_filename, as_numpy=as_numpy) def set_scan_pattern(self, config=None, name=None, persist = False): """ Function to set a new scan pattern, see: :any:`protobuf_protocol`. diff --git a/tests/src/file.cpp b/tests/src/file.cpp index f66bde1..4703bce 100644 --- a/tests/src/file.cpp +++ b/tests/src/file.cpp @@ -61,6 +61,6 @@ INSTANTIATE_TEST_CASE_P( simulate_record_and_read, file_simulate_record_and_read, ::testing::Values( - "../tests/assets/dump.bfpc" - // "../tests/assets/packed_dump.bfpc" + "../tests/assets/dump.bfpc", + "../tests/assets/packed.bfpc" ));