3 Replies Latest reply on Jul 11, 2018 3:33 AM by MartyG

    Read Raw Depth Image with MATLAB/Record Stream

    Avishay

      Hi,

      I'm new in using Intel RealSense Depth module.

      Currently I have 2 modules - D415/D435

      I have downloaded the Intel.RealSense.Viewer.exe and started Depth and Video streams.

      I have captured 1 raw Depth image and now trying simply to read it in MATLAB.

      I'm using a very simple code:

      FID = fopen('IntelDepth.raw');

      DepthImage = fread(FID, [720, 1280], 'uint8');

      fclose(FID)

       

      but I get a Depth image which is probably wrong.

       

      Another issue I would like to handle - Is there any simple way to capture a stream of images instead of 1 with Intel.RealSense.Viewer.exe?

       

      Thanks!

        • 1. Re: Read Raw Depth Image with MATLAB/Record Stream
          MartyG

          A MATLAB wrapper for the RealSense SDK 2.0 is currently being worked on by the RealSense development team, which should make using the 400 Series cameras with MATLAB much easier.  The most recent estimate of a release schedule for this on June 27 was in 'a couple of sprints' (sprints being terminology for development time-cycles).

           

          So as the SDK tends to get updated roughly every couple of weeks, I would estimate that 'a couple of sprints' after June 27 might be the update after next, maybe around end July / start August.  That's by no means an official date though .... "it's here when it's here" is probably better. 

           

          Regarding capturing all frames with the RealSense Viewer: the Viewer can record frames into a file type called a 'rosbag'.  Bear in mind though that the resultant file can be very large, with some reporting file sizes in the range of 20 GB.  On the link below, scroll down to the heading 'Record and playback in RealSense Viewer'.

           

          librealsense/readme.md at master · IntelRealSense/librealsense · GitHub

          • 2. Re: Read Raw Depth Image with MATLAB/Record Stream
            Avishay

            Dear Marty,

            Thank you for your prompt reply.

            I understand that soon RealSense SDK will soon include MATLAB wrapper.

            Though, in case I would like to try some basic and simple function such as reading Depth image into a numeric matrix (preferably with MATLAB but not mandatory) is there any simple method to read the raw image and rosbag file?

            Is there an option to record (and later read) Disparity file?

            • 3. Re: Read Raw Depth Image with MATLAB/Record Stream
              MartyG

              The best reference currently available as far as I know is a long discussion about generating a disparity map with the 400 Series.

               

              Issues with custom disparity generation