-
-
Save omair18/f3b85a7085b5b006c5ba919269f1db3c to your computer and use it in GitHub Desktop.
convert pts file to pcd file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filename="DamagedBeam.pts" | |
from numpy import loadtxt | |
from numpy import savetxt | |
lines = loadtxt(filename,skiprows=1) | |
size=str(lines[:,0].size) | |
header = "VERSION .7\nFIELDS x y z\nSIZE 4 4 4\nTYPE F F F\nCOUNT 1 1 1\nWIDTH "+size+"\nHEIGHT 1\nVIEWPOINT 0 0 0 1 0 0 0\nPOINTS "+size+"\nDATA ascii" | |
pcd=lines[:,[0,1,2]] | |
savetxt("DamagedBeam.pcd", pcd, fmt="%f",header=header,comments='') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment