Crashing SVO playback for body masks


I am implementing body masks using the C++ SDK. Since the SDK only provides a unique binary mask per tracking body, instead of a single combined mask with all bodies in it, I referred to this code from StereoLabs. It works great for live camera feed.

However, I want to also apply body masks for SVO playback. I created multiple SVO files using ZED Explorer. I’ve noticed that for the larger-resolution SVO files (ex. HD1080, HD2K), calling mask_ocv(cv::Rect(a, b, local_mask.cols, local_mask.rows)).setTo(, local_mask); consistently crashes my program. It’s specifically the .setTo(, local_mask); that is causing the crash. I am getting an “Access violation reading location 0x000…” error, but the reading location is within the datastart and dataend bounds of the cv::Mat local_mask.

I do not get this crash for lower-resolution playbacks like HD720. Any help would be greatly appreciated. Thank you.

Hey @dko, welcome to the forums!

Do you reproduce the issue with live feeds too?

Hi @JPlou

Oh yes, sorry. I have been able to reproduce using live feed as well. I’ve been testing on lower resolution more often for live feed, so I forgot that it also crashes on higher resolutions for live feed.

Ok, good to know :+1:

  • Can I understand that you can use all samples/tools like Depth Viewer well in higher resolutions?
  • When using 720p, can you run at 60fps?
  • Could you send either here or at a result file of ZED Diagnostic? (by clicking the “Save” button at the end of the process")
  1. Yes, I can run Depth Viewer in higher resolutions like HD2K without any issues.
  2. Yes, I can run 60 fps for 720p on Depth Viewer.
  3. Sure, I will send it to
1 Like


I reproduced the issue in 4.0.8 on my side, I’m looking into it.

Thank you very much.

There’s an issue with 4.0.8 where the mask could get corrupted that has been fixed in an upcoming 4.1 release.
Sorry for the inconvenience, a fix will be coming soon.

1 Like