Last active
September 17, 2020 13:10
-
-
Save joschuck/19b26aab50e6f302602de6c32488069b to your computer and use it in GitHub Desktop.
Smooth out a depth image or array from lidar measurements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy import ndimage | |
from PIL import Image | |
[...] | |
lidar_image = np.array(Image.open(filename)) | |
smooth_lidar_image = Image.fromarray(ndimage.filters.maximum_filter(lidar_image, (5,5)), mode='I') |
same problem as keishatsai. Could you help?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, I have tried your code , but I got the following errors:
Do you have any idea what this might happen?
I named module Image from PIL as getVELOIMG
Traceback (most recent call last):
File "projectVelo_detail.py", line 238, in
smooth_lidar_image = getVELOIMG.fromarray(ndimage.filters.maximum_filter(lidar_image, (5,5)), mode='I')
File "/usr/lib/python2.7/dist-packages/scipy/ndimage/filters.py", line 970, in maximum_filter
cval, origin, 0)
File "/usr/lib/python2.7/dist-packages/scipy/ndimage/filters.py", line 903, in _min_or_max_filter
sizes = _ni_support._normalize_sequence(size, input.ndim)
File "/usr/lib/python2.7/dist-packages/scipy/ndimage/_ni_support.py", line 64, in _normalize_sequence
raise RuntimeError(err)
RuntimeError: sequence argument must have length equal to input rank