Segmentation Fault When Visualizing Live Fused Point Cloud with PCL Viewer

Hi all,

I’m working on a project that involves fusing point cloud data from two ZED2i cameras. My workflow is as follows:

  • Calibration: I use ZED360 to obtain the calibration parameters for my multi-camera setup.
  • Fusion: I use the Stereolabs Fusion API (from the ZED SDK 5) to combine the data streams.
  • Visualization: I can successfully visualize the fused point cloud in real time using the provided GLViewer.

My goal:
I need to process the fused point cloud further (e.g., for object detection with YOLO), so I’m trying to downsample the fused cloud using PCL’s VoxelGrid filter. I want to visualize the live (not saved) downsampled point cloud using PCL’s viewer (pcl::visualization::PCLVisualizer or CloudViewer), instead of GLViewer.

What Works

  • I can save the downsampled point cloud to disk and view it with pcl_viewer without any issues.
  • The live fused cloud displays correctly in GLViewer.

What Fails

  • When I try to visualize the live fused or live downsampled point cloud with PCL’s viewer (in the same process, not from a saved file), I get a segmentation fault (Segmentation fault (core dumped)).
  • I have tried both my own code and the official Stereolabs ZED + PCL sample from this repo, but the error persists.
  • The error occurs as soon as the PCL viewer window opens, before any cloud is rendered.

My Setup

  • Cameras: 2 × ZED2i
  • Calibration: ZED360
  • Fusion: ZED SDK 5 (Ubuntu 22.04)
  • Downsampling: PCL VoxelGrid
  • Visualization: PCL Visualizer (pcl::visualization::PCLVisualizer or CloudViewer)
  • GLViewer works fine
  • PCL version: 1.12 (Ubuntu package)
  • VTK version: 9.1 (Ubuntu package)

What I’ve Tried

  • Verified that the point cloud pointer is valid and persistent throughout the viewer’s lifetime.
  • Ensured the cloud dimensions match the ZED output (width × height).
  • Protected all cloud access with mutexes (since I’m using threads for ZED data acquisition).
  • Checked that the cloud is non-empty before updating the viewer.
  • Used both my own code and the official Stereolabs ZED + PCL sample code.
  • The crash always occurs in the X11/VTK event loop, specifically during spinOnce() or showCloud().

Why I Need PCL Viewer

I need to further process the fused point cloud (e.g., for object detection with YOLO or other models), and PCL’s data structures and visualization tools are essential for my workflow.

Error Details

  • The segmentation fault occurs as soon as the PCL viewer window opens (before any points are rendered).
  • Saving the cloud and viewing it with pcl_viewer from the command line works fine.
  • The error persists even when using the official Stereolabs sample code.

Request

Has anyone successfully visualized a live fused (or downsampled) point cloud from two ZED2i cameras using PCL’s viewer on Ubuntu 22.04 with ZED SDK 5?

  • Is there a known compatibility issue between ZED SDK 5, PCL 1.12, and VTK 9.1?
  • Are there additional steps needed to make the live point cloud compatible with PCL’s viewer?
  • Any suggestions for debugging or workarounds?

Any help or advice would be greatly appreciated!

I have attached a screenshot of the error and am happy to provide code snippets or more details as needed.