toinsson / pyrealsense

Cross-platform ctypes/Cython wrapper to the librealsense library (v1.x)
http://pyrealsense.readthedocs.io
Apache License 2.0
121 stars 46 forks source link

Data type checking #53

Open cedricjeanty opened 7 years ago

cedricjeanty commented 7 years ago

| Camera Model | SR300 | | Firmware Version | 3.15.0 | | Ubuntu 16.04 | | librealsense version | 1.12.1 | | pyrealsense version | 2.1 |

Thank you for the great library! Can I suggest adding data type checking for functions like project_pixel_to_point and deproject_point_to_pixel. When I used np.int and np.float64 data types for arguments, results are garbled. I had to convert my data types to np.float32. Thanks!

toinsson commented 7 years ago

True, thanks for pointing this out. Could raise a warning if wrong data type passed and return zeros.