From ad692447af6e0747efc03c7009442cebc2b93d38 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 24 Nov 2023 17:17:07 +0100 Subject: [PATCH] Remove timing print in MBT data conversion --- modules/python/bindings/include/mbt.hpp | 3 --- modules/python/examples/synthetic_data_mbt.py | 7 +++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/python/bindings/include/mbt.hpp b/modules/python/bindings/include/mbt.hpp index b3cd321b4a..311d56252c 100644 --- a/modules/python/bindings/include/mbt.hpp +++ b/modules/python/bindings/include/mbt.hpp @@ -14,7 +14,6 @@ void bindings_vpMbGenericTracker(py::class_ &py std::map> &mapOfPointClouds) { std::map mapOfWidths, mapOfHeights; std::map mapOfVectors; - double t = vpTime::measureTimeMs(); for (const auto &point_cloud_pair: mapOfPointClouds) { py::buffer_info buffer = point_cloud_pair.second.request(); @@ -36,8 +35,6 @@ void bindings_vpMbGenericTracker(py::class_ &py for (const auto &p: mapOfVectors) { mapOfVectorPtrs[p.first] = &(p.second); } - double tt = vpTime::measureTimeMs(); - std::cout << (tt - t) << std::endl; self.track(mapOfImages, mapOfVectorPtrs, mapOfWidths, mapOfHeights); diff --git a/modules/python/examples/synthetic_data_mbt.py b/modules/python/examples/synthetic_data_mbt.py index 367a070d9b..d140b79d89 100644 --- a/modules/python/examples/synthetic_data_mbt.py +++ b/modules/python/examples/synthetic_data_mbt.py @@ -96,15 +96,14 @@ def read_data(exp_config: MBTConfig, cam_depth: CameraParameters | None, I: Imag print('Could not successfully read the depth image') return t = time.time() - point_cloud = np.empty((*I_depth_np.shape, 3), dtype=np.float64) + # point_cloud = np.empty((*I_depth_np.shape, 3), dtype=np.float64) Z = I_depth_np.copy() Z[Z > 2] = 0.0 # Clamping values that are too high vs, us = np.meshgrid(range(I_depth_np.shape[0]), range(I_depth_np.shape[1]), indexing='ij') xs, ys = PixelMeterConversion.convertPoints(cam_depth, us, vs) - point_cloud[..., 0] = xs * Z - point_cloud[..., 1] = ys * Z - point_cloud[..., 2] = Z + point_cloud = np.stack((xs * Z, ys * Z, Z), axis=-1) + print(f'\tPoint_cloud took {(time.time() - t) * 1000}ms')