windows点云pcd转bin

代码链接,该代码中pypcd依赖python2,python3中不好用

GitHub - Zhou-Renjie/pcd2bin: .pcd to .bin converter (python)

$ pip install numpy
$ pip install argparse
$ pip install pypcd
$ pip install tqdm

安装pypcd时报错:

1.

building 'lzf' extension
error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27

双击安装VCForPython27.msi即可

2.

error: command ‘C:\Users\***\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe’ failed with exit status 2

把stdin.h复制到下面的路径下即可

C:\Users\***\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include

3.

使用pypcd时出现ValueError: field '__0000' occurs more than once

打开pypcd安装位置的pypcd.py,安装位置可以在报错界面查看:

C:\Users\***\.conda\envs\py27\Lib\site-packages\pypcd\pypcd.py

找到77行左右

def parse_header(lines): 
     """ Parse header of PCD files. 
     """ 
     metadata = {} 
     for ln in lines: 
         if ln.startswith('#') or len(ln) < 2: 
             continue 
         match = re.match('(\w+)\s+([\w\s\.]+)', ln) 

改为

def parse_header(lines): 
     """ 
     Parse header of PCD files. 
     """ 
    metadata = {} 
    for ln in lines: 
        if ln.startswith('#') or len(ln) < 2: 
        	continue 
        ln = ln.replace('_','s',1)
        ln = ln.replace('_','m',1)
    	match = re.match('(\w+)\s+([\w\s.]+)', str(ln))

其他的pypcd问题在下面网站找到:

Issues · dimatura/pypcd (github.com)

运行程序:

python pcd2bin.py --pcd_path={path of input pcd file directory} --bin_path={path of output bin file directory}

或者在程序中直接填写你的文件路径

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值