1 Reply Latest reply on Apr 10, 2018 12:26 AM by MartyG

    D415 - Basic Code For Saving Depth Stream As Binary File


      I am a complete beginner to coding. I can do some things in Matlab and Python but that's about it. All I want to do is record depth with my D415 camera and save the stream as a binary file (little endian) that contains the depth value of every pixel for each frame (all I want is depth, nothing else). So if my resolution is 840x480, I want a file that has 840 X 480 depth values for every frame. Here is what I can do myself. I can implement, the examples on github. I am able to get my linux machine to run:


        $ g++ -std=c++11 rs-save-to-disk.cpp -lrealsense2

      from librealsense/examples/save-to-disk at master · IntelRealSense/librealsense · GitHub


        $ gcc depth.c -lrealsense2

      from librealsense/examples/C/depth at master · IntelRealSense/librealsense · GitHub


      My understanding of these languages is so small that I cannot simply read the sdk and do what I want. (If I was working in MATLAB I could do that no problem).


      There must be code out there SOMEWHERE that accomplishes my very basic task.


      My end goal is to be able to record with the camera for hours. I eventually want to model the depth data and do some real time processing (sort of like object recognition). Please help me out, I'd be very grateful. I'm looking for code I can copy and paste and use right away or a step by step (so simple that a child could understand) walk through of how to do this myself. I'd prefer the former. In the meantime I am learning c and c++ from scratch.