How to merge two point clouds

I`ve got two calibrated (with AQS12Piece) point clouds and want to merge them. How can I achieve this?

Hello MSe,

unfortunatly this is not yet integrated in cvb.
But you can write this own PointCloud extension:

static class PointCloudExtensions
{
  public static SparsePointCloud Concatenate(this PointCloud first, PointCloud second)
  {
     if (first == null)
        throw new ArgumentNullException(nameof(first));
     if (second == null)
        throw new ArgumentNullException(nameof(second));

     var target = SparsePointCloud.Create<Point3Df>(first.NumPoints + second.NumPoints);
     unsafe
     {
        var pTarget = (Point3Df*)target.PointComponents.X.BasePtr;
        foreach (var pt in first.TryEnumeratePointsAs<Point3Df>())
        {
          *pTarget = pt;
          ++pTarget;
        }
        foreach (var pt in second.TryEnumeratePointsAs<Point3Df>())
        {
          *pTarget = pt;
          ++pTarget;
        }
      }
      return target;
    }
  }
}

Kind regards
Arno Dietz

3 Likes