Browse Source

Fix data shape for MaxHeightImage construction

ros_numpy will set the shape of the points buffer from a PCL message to the image dimensions (W,H), but this causes the underlying numba implementation to blow up when it tries to iterate over the points as though they were in a flat array. This change ensures that a flat view of the data is passed through. It does not appear that this extra shape information is used for anything anyway
pull/56/head
Nick Walker 2 years ago
parent
commit
587d2ccab4
No known key found for this signature in database GPG Key ID: 212C961E6C8EEA3B
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      stretch_funmap/src/stretch_funmap/max_height_image.py

+ 2
- 2
stretch_funmap/src/stretch_funmap/max_height_image.py View File

@ -520,8 +520,8 @@ class MaxHeightImage:
self.rgb_image = np.zeros(s[:2] + (3,), np.uint8)
if self.camera_depth_image is None:
nh.numba_max_height_and_rgb_images(points_to_image_mat, rgb_points, self.image, self.rgb_image, self.m_per_pix, self.m_per_height_unit, self.voi.x_in_m, self.voi.y_in_m, self.voi.z_in_m, verbose=False)
nh.numba_max_height_and_rgb_images(points_to_image_mat, rgb_points.ravel(), self.image, self.rgb_image, self.m_per_pix, self.m_per_height_unit, self.voi.x_in_m, self.voi.y_in_m, self.voi.z_in_m, verbose=False)
else:
nh.numba_max_height_and_rgb_and_camera_depth_images(points_to_image_mat, rgb_points, self.image, self.rgb_image, self.camera_depth_image, self.m_per_pix, self.m_per_height_unit, self.voi.x_in_m, self.voi.y_in_m, self.voi.z_in_m, verbose=False)
nh.numba_max_height_and_rgb_and_camera_depth_images(points_to_image_mat, rgb_points.ravel(), self.image, self.rgb_image, self.camera_depth_image, self.m_per_pix, self.m_per_height_unit, self.voi.x_in_m, self.voi.y_in_m, self.voi.z_in_m, verbose=False)

Loading…
Cancel
Save