microsoft / Azure-Kinect-Sensor-SDK

A cross platform (Linux and Windows) user mode SDK to read data from your Azure Kinect device.
https://Azure.com/Kinect
MIT License
1.47k stars 613 forks source link

k4a_image_get_size() returns unexpected values #1976

Open denniskb opened 2 months ago

denniskb commented 2 months ago

Expected behavior

k4a_image_get_size() should return:

Observation

Most of the time, the above is true. However, sporadically, k4a_image_get_size() returns a size that is less than the expected quantity for formats YUY2 and NV12. For example, I observed these values for a resolution of 720p and the YUY2 format (every few seconds/every few hundred frames):

cannot reshape array of size 1705140 into shape (720,1280,newaxis)
cannot reshape array of size 1695936 into shape (720,1280,newaxis)
cannot reshape array of size 1815588 into shape (720,1280,newaxis)
cannot reshape array of size 1815588 into shape (720,1280,newaxis)
cannot reshape array of size 1815588 into shape (720,1280,newaxis)
cannot reshape array of size 1705140 into shape (720,1280,newaxis)
cannot reshape array of size 1815588 into shape (720,1280,newaxis)
cannot reshape array of size 1668324 into shape (720,1280,newaxis)
cannot reshape array of size 1815588 into shape (720,1280,newaxis)
cannot reshape array of size 1815588 into shape (720,1280,newaxis)
cannot reshape array of size 1705140 into shape (720,1280,newaxis)
cannot reshape array of size 1815588 into shape (720,1280,newaxis)
cannot reshape array of size 1815588 into shape (720,1280,newaxis)
cannot reshape array of size 1815588 into shape (720,1280,newaxis)
cannot reshape array of size 1705140 into shape (720,1280,newaxis)
cannot reshape array of size 1815588 into shape (720,1280,newaxis)