资源简介
matlab开发-CSF批次模拟过滤器。基于布料模拟的激光雷达点云地面滤波/分割(裸地提取)方法。
代码片段和文件信息
// ======================================================================================
// Copyright 2017 State Key Laboratory of Remote Sensing Science
// Institute of Remote Sensing Science and Engineering Beijing Normal University
// Licensed under the Apache License Version 2.0 (the “License“);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing software
// distributed under the License is distributed on an “AS IS“ BASIS
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ======================================================================================
#include
#include “Cfg.h“
#include “../src/CSF.h“
#include
#include
#include
#include
using namespace std;
int main(int argcchar* argv[])
{
//读取文本参数,仅用于调试
Cfg cfg;
string slop_smooth;
cfg.readConfigFile(“params.cfg“ “slop_smooth“ slop_smooth);
bool ss = false;
if (slop_smooth == “true“ || slop_smooth == “True“)
{
ss = true;
}
else if (slop_smooth == “false“ || slop_smooth == “False“)
{
ss = false;
}
else{
if (atoi(slop_smooth.c_str()) == 0){
ss = false;
}
else
{
ss = true;
}
}
string class_threshold;
cfg.readConfigFile(“params.cfg“ “class_threshold“ class_threshold);
string cloth_resolution;
cfg.readConfigFile(“params.cfg“ “cloth_resolution“ cloth_resolution);
string iterations;
cfg.readConfigFile(“params.cfg“ “iterations“ iterations);
string rigidness;
cfg.readConfigFile(“params.cfg“ “rigidness“ rigidness);
string time_step;
cfg.readConfigFile(“params.cfg“ “time_step“ time_step);
string terr_pointClouds_filepath;
cfg.readConfigFile(“params.cfg“ “terr_pointClouds_filepath“ terr_pointClouds_filepath);
CSF csf;
//step 1 输入点云
csf.readPointsFromFile(terr_pointClouds_filepath);
clock_t start end;
start = clock();
//备注:在实际使用过程中,点云数据由主程序提供,调用函数为
//csf.setPointCloud(pc);//pc为PointCloud类
//step 2 设置参数
csf.params.bSloopSmooth = ss;
csf.params.class_threshold = atof(class_threshold.c_str());
csf.params.cloth_resolution = atof(cloth_resolution.c_str());
csf.params.interations = atoi(iterations.c_str());
csf.params.rigidness = atoi(rigidness.c_str());
csf.params.time_step = atof(time_step.c_str());
//step3 执行滤波result中储存的是地面点的索引
std::vector groundIndexes offGroundIndexes;
if (argc == 2 && strcmp(argv[1] “-c“)==0)
{
cout << “Export cloth enabled.“ << endl;
csf.do_filtering(groundIndexes offGroundIndexes true);
}
else
{
csf.do_filtering(groundIndexes offGroundIndexes false);
}
end = clock();
double dur = (double)(end - start);
printf(“Use Time:%f\n“ (dur / CLOCKS_PER_SEC));
csf.savePoints(groundIndexes“ground.txt“);
csf.savePoin
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-05-30 06:29 jianboqi-CSF-b4cac09\
文件 96 2019-05-30 06:29 jianboqi-CSF-b4cac09\CMakeLists.txt
目录 0 2019-05-30 06:29 jianboqi-CSF-b4cac09\CSFDemo\
文件 235 2019-05-30 06:29 jianboqi-CSF-b4cac09\CSFDemo\CMakeLists.txt
文件 391218 2019-05-30 06:29 jianboqi-CSF-b4cac09\CSFDemo\CSF1.png
文件 462606 2019-05-30 06:29 jianboqi-CSF-b4cac09\CSFDemo\CSF2.png
文件 3118 2019-05-30 06:29 jianboqi-CSF-b4cac09\CSFDemo\CSFDemo.cpp
文件 1727 2019-05-30 06:29 jianboqi-CSF-b4cac09\CSFDemo\Cfg.h
文件 11357 2019-05-30 06:29 jianboqi-CSF-b4cac09\LICENSE.txt
文件 3891 2019-05-30 06:29 jianboqi-CSF-b4cac09\README.md
目录 0 2019-05-30 06:29 jianboqi-CSF-b4cac09\matlab\
文件 2624 2019-05-30 06:29 jianboqi-CSF-b4cac09\matlab\csf_filtering.cpp
文件 1991 2019-05-30 06:29 jianboqi-CSF-b4cac09\matlab\demo_mex.m
文件 3369 2019-05-30 06:29 jianboqi-CSF-b4cac09\matlab\demo_with_toolbox.m
文件 3565 2019-05-30 06:29 jianboqi-CSF-b4cac09\matlab\demo_without_toolbox.m
文件 2857 2019-05-30 06:29 jianboqi-CSF-b4cac09\matlab\readme.txt
文件 2400216 2019-05-30 06:29 jianboqi-CSF-b4cac09\matlab\sample.ply
文件 4500000 2019-05-30 06:29 jianboqi-CSF-b4cac09\matlab\sample.txt
目录 0 2019-05-30 06:29 jianboqi-CSF-b4cac09\python\
文件 293 2019-05-30 06:29 jianboqi-CSF-b4cac09\python\CSF.i
文件 17277 2019-05-30 06:29 jianboqi-CSF-b4cac09\python\CSF.py
文件 504704 2019-05-30 06:29 jianboqi-CSF-b4cac09\python\CSF_wrap.cxx
文件 209 2019-05-30 06:29 jianboqi-CSF-b4cac09\python\Makefile
目录 0 2019-05-30 06:29 jianboqi-CSF-b4cac09\python\PrecompiledForAnaconda2\
文件 217 2019-05-30 06:29 jianboqi-CSF-b4cac09\python\PrecompiledForAnaconda2\CSF-1.1-py2.7.egg-info
文件 16748 2019-05-30 06:29 jianboqi-CSF-b4cac09\python\PrecompiledForAnaconda2\CSF.py
文件 30774 2019-05-30 06:29 jianboqi-CSF-b4cac09\python\PrecompiledForAnaconda2\CSF.pyc
文件 299520 2019-05-30 06:29 jianboqi-CSF-b4cac09\python\PrecompiledForAnaconda2\_CSF.pyd
文件 50 2019-05-30 06:29 jianboqi-CSF-b4cac09\python\PrecompiledForAnaconda2\readme.txt
文件 289 2019-05-30 06:29 jianboqi-CSF-b4cac09\python\notes.txt
文件 965 2019-05-30 06:29 jianboqi-CSF-b4cac09\python\setup.py
............此处省略19个文件信息
评论
共有 条评论