1 Reply Latest reply on Jun 6, 2018 2:54 AM by jb455

    How to find the stride

    MoA

      I have two questions, as follows:

       

      1) When using the get_depth_frame().get_data() or  get_color_frame().get_data(), does one assume that the returned pointer points to a section of memory where the stride is the same the width of the image? If not, how does one fine the stride?

       

      2) With color images, is the data in the form of planar (one plane for each color band, Red plane 1st, then Green plane, and finally Blue plane) or packed (three consecutive bytes corresponding to the BGR color for one pixel)?

       

      Mo

       

       

        • 1. Re: How to find the stride
          jb455

          Maybe it's different in C++, but using the C# wrapper I can read the `stride` property of a `VideoFrame` object directly. If you can't get that, it'll just be the image width multiplied by bytes per pixel.

           

          The colour image is stored as consecutive RGB (or whatever pixel format you choose) bytes for each pixel.