Skip to content

Commit

Permalink
Remove timing print in MBT data conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFlt committed Nov 24, 2023
1 parent 147b94b commit ad69244
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 0 additions & 3 deletions modules/python/bindings/include/mbt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ void bindings_vpMbGenericTracker(py::class_<vpMbGenericTracker, vpMbTracker> &py
std::map<std::string, py::array_t<double, py::array::c_style>> &mapOfPointClouds) {
std::map<std::string, unsigned int> mapOfWidths, mapOfHeights;
std::map<std::string, vpMatrix> mapOfVectors;
double t = vpTime::measureTimeMs();
for (const auto &point_cloud_pair: mapOfPointClouds) {

py::buffer_info buffer = point_cloud_pair.second.request();
Expand All @@ -36,8 +35,6 @@ void bindings_vpMbGenericTracker(py::class_<vpMbGenericTracker, vpMbTracker> &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);


Expand Down
7 changes: 3 additions & 4 deletions modules/python/examples/synthetic_data_mbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')


Expand Down

0 comments on commit ad69244

Please sign in to comment.