How to convert sl::Mat point cloud to pcl::PointCloud?

Hi, my friends. i got a problem that how to convert sl::Mat point cloud to pcl::PointCloud.


The method i used to convert it shows in picture. But it spend much times,and a lot of points in the sl::Mat
is NAN, do you have a approach to convert it efficiently?
Please help.Thanks!

a very generic way to speed up for loops like that is to multithread them. You can basically add
#pragma omp parallel for
on top on your for loop for that.