ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Merge multiple pcd files.....

asked 2023-01-19 07:39:49 -0600

LEE gravatar image

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?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2023-01-20 10:31:17 -0600

Ranjit Kathiriya gravatar image

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)
edit flag offensive delete link more

Comments

1

OK I completly fix my problem! Thank You!!

LEE gravatar image LEE  ( 2023-01-22 00:17:58 -0600 )edit
0

answered 2023-01-20 07:15:42 -0600

Ifx13 gravatar image

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.

edit flag offensive delete link more

Comments

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

LEE gravatar image LEE  ( 2023-01-20 07:22:48 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2023-01-19 07:39:49 -0600

Seen: 902 times

Last updated: Jan 20 '23