Items with no label
3335 Discussions

How to find the stride

MAbdo2
New Contributor I
1,380 Views

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

0 Kudos
1 Reply
jb455
Valued Contributor II
402 Views

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.

0 Kudos
Reply