Robotics StackExchange | Archived questions

Merge multiple pcd files.....

Hi, I have to do the process of merging a large number of pcd files into one.

I have five folders. For example, when there is a folder called 1,2,3,4,5, I try to merge 1.pcd in folder1 and 1.pcd in folder2 and 1.pcd in folder3 and 1.pcd in folder4 and 1.pcd in folder5.

And there are about 3000 pcd files in each folder.

I think it will be difficult to merge one by one, so is there a tool that makes it easy?

Asked by LEE on 2023-01-19 08:39:49 UTC

Comments

Answers

I would suggest using the open3D python library, you can read pointclouds of many formats and then concatenate them in a "global" point cloud object which you can then export in the format you want.

I can't post an example right now because I'm on my smartphone but if you have trouble finding it out i will post an example later.

Asked by Ifx13 on 2023-01-20 08:15:42 UTC

Comments

Okay, thanks. I haven't solved this problem in a few days, so I really want to solve it :)

Asked by LEE on 2023-01-20 08:22:48 UTC

Hello @LEE,

You can use open3D Library for that I think that is the best. You also can use a sample code snippet that is below,

import open3d as o3d 
import numpy as np

point_cloud = []
for i in glob.glob("dataset/3.6/*/*.pcd"):  # * means inner directory
    pcd = o3d.io.read_point_cloud(i)
    a = np.array(pcd.points)
    point_cloud.append(a)

Asked by Ranjit Kathiriya on 2023-01-20 11:31:17 UTC

Comments

OK I completly fix my problem! Thank You!!

Asked by LEE on 2023-01-22 01:17:58 UTC