Items with no label
3338 Discussions

Depth- och IR-data from RealSense camera (SR300)?

AKarl2
Beginner
2,157 Views

I try to combine a realsense SR300 camera, OpenCV and TensorFlow under Windows.

I can get that RGB stream from the camera when using OpenCV in python on windows. But how do I get the depth and IR image in python or do I have to do it all in c++?

I have found https://github.com/binraker/PyRealSense PyRealSense but I don't know how to install it as I have never worked with Python earlier. Is PyRealSense, what I need or what do I need to get this combination with ir and depth to work?

0 Kudos
3 Replies
MartyG
Honored Contributor III
907 Views

Developers who want to use RealSense with Python and OpenCV usually use the open-source Librealsense SDK, which apparently has pyRealSense support integrated into it.

https://github.com/IntelRealSense/librealsense GitHub - IntelRealSense/librealsense: Cross-platform camera capture for Intel® RealSense™ F200, SR300 and R200

With that SDK, some people have also used a script called cpp-tutorial-2-streams.cpp or a similar one to display 4 different types of camera stream onscreen simultaneously.

Here's a link to the cpp-tutorial-2-streams.cpp script.

https://github.com/IntelRealSense/librealsense/blob/master/examples/cpp-tutorial-2-streams.cpp librealsense/cpp-tutorial-2-streams.cpp at master · IntelRealSense/librealsense · GitHub

This forum thread that discusses using RealSense with Python may also be of use to you.

0 Kudos
AKarl2
Beginner
907 Views

Thank you MartyG, but I guess I need more tutorial-like instructions to install librealsense with python to get it working.

0 Kudos
MartyG
Honored Contributor III
907 Views

Projects on GitHub, like Librealsense, do not typically have beginner-friendly instructions, probably because they assume that people using the likes of Linux have a certain level of tech skill already. The most user-friendly installation guide for Librealsense that I could find was this one.

http://wiki.ros.org/librealsense librealsense - ROS Wiki

I also managed to dig up the link to Librealsense's own official installation guide.

https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md librealsense/installation.md at master · IntelRealSense/librealsense · GitHub

Usually when presented with overly complicated manuals, I write my own setup guide instead so I know exactly how it works. Maybe I should do a beginners install guide for Librealsense some day!

As for installing Python support in Librealsense ... whilst I have not tried it myself, I notice that Librealsense's manual simply provides a link to a download for pyRealSense. This suggests to me that if you already have pyRealSense installed then Librealsense should be able to make use of it. If I'm incorrect about that, I'm sure a Librealsense / Python user in the community will kindly correct me.

0 Kudos
Reply