资源简介
源文件夹包含基于PCL实现的树结构建立,最近邻搜索,区域生长,采样分割等

代码片段和文件信息
#include
#include
#include
#include
#include
#include
#include
#include
#include
typedef std::pair > vfh_model;
/** \brief Loads an n-D histogram file as a VFH signature
* \param path the input file name
* \param vfh the resultant VFH model
*/
bool
loadHist (const boost::filesystem::path &path vfh_model &vfh)
{
int vfh_idx;
// Load the file as a PCD
try
{
sensor_msgs::PointCloud2 cloud;
int version;
Eigen::Vector4f origin;
Eigen::Quaternionf orientation;
pcl::PCDReader r;
int type; unsigned int idx;
r.readHeader (path.string () cloud origin orientation version type idx);
vfh_idx = pcl::getFieldIndex (cloud “vfh“);
if (vfh_idx == -1)
return (false);
if ((int)cloud.width * cloud.height != 1)
return (false);
}
catch (pcl::InvalidConversionException e)
{
return (false);
}
// Treat the VFH signature as a single Point Cloud
pcl::PointCloud point;
pcl::io::loadPCDFile (path.string () point);
vfh.second.resize (308);
std::vector fields;
pcl::getFieldIndex (point “vfh“ fields);
for (size_t i = 0; i < fields[vfh_idx].count; ++i)
{
vfh.second[i] = point.points[0].histogram[i];
}
vfh.first = path.string ();
return (true);
}
/** \brief Load a set of VFH features that will act as the model (training data)
* \param argc the number of arguments (pass from main ())
* \param argv the actual command line arguments (pass from main ())
* \param extension the file extension containing the VFH features
* \param models the resultant vector of histogram models
*/
void
loadFeatureModels (const boost::filesystem::path &base_dir const std::string &extension
std::vector &models)
{
if (!boost::filesystem::exists (base_dir) && !boost::filesystem::is_directory (base_dir))
return;
for (boost::filesystem::directory_iterator it (base_dir); it != boost::filesystem::directory_iterator (); ++it)
{
if (boost::filesystem::is_directory (it->status ()))
{
std::stringstream ss;
ss << it->path ();
pcl::console::print_highlight (“Loading %s (%lu models loaded so far).\n“ ss.str ().c_str () (unsigned long)models.size ());
loadFeatureModels (it->path () extension models);
}
if (boost::filesystem::is_regular_file (it->status ()) && boost::filesystem::extension (it->path ()) == extension)
{
vfh_model m;
if (loadHist (base_dir / it->path ().filename () m))
models.push_back (m);
}
}
}
int
main (int argc char** argv)
{
if (argc < 2)
{
PCL_ERROR (“Need at least two parameters! Syntax is: %s [model_directo
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4753 2012-05-27 23:46 build_tree.cpp
文件 960 2012-05-27 23:49 CMakeLists.txt
文件 2152 2016-06-14 23:51 conditional_euclidean_clustering.cpp
文件 2038 2016-06-14 23:51 min_cut_segmentation.cpp
文件 9927 2012-05-27 23:48 nearest_neighbors.cpp
文件 2005 2016-06-14 23:51 region_growing.cpp
文件 2194 2016-06-14 23:51 region_growing_rgb.cpp
文件 2429 2016-06-14 23:51 sac_segmentation.cpp
文件 2022 2016-06-14 23:51 segment_differences.cpp
文件 4053 2017-03-07 21:35 segmentation_0.cpp
----------- --------- ---------- ----- ----
32533 10
- 上一篇:DXC采集商业版+50条采集规则
- 下一篇:基于功率预测模型的并网逆变器直接功率控制
相关资源
- 语音信号处理 赵力
- [免费]图像识别c 源码
- 一个人脸识别程序源码
- 基于bp神经网络的表情识别
- 支持向量机的船舶目标识别
- 基于OpenCV的数字识别468815
- LDA 人脸识别
- 血液图像处理—细胞识别
- 编译词法分析器识别关键字常数和符
- DSP 语音识别程序 DTW MFCC
- 汉印A300 CPCL协议 android 热敏打印app(
- halcon简单实现人脸识别.hdev
- scratch -教学案例 识别物品颜色.sb3
- OCR识别字符
- halcon-ocr训练及识别
- Halcon车牌识别
- 基于HALCON识别指示灯亮灭和OCR识别.
- 滑块验证码无原图纯计算识别坐标.
- 解决Y470/Y570更新2.12BIOS后无法识别8G内
- 百度API车牌识别DEMO.rar
- 百度图片识别源码.rar
- 物联网中无线传感器节点和RFID数据融
- 常用电子元器件图片识别
- 电子元器件识别
- IBM CAW for Microsoft Cluster Server 简介
- 基于进化算法的岩体参数智能识别
- 超级场景清理器(SPCleaner)v1.0免费版
- Intel Parallel Studio XE Cluster Edition for W
- INBarcodeOCR条码识别组件,识别率及速
- 文软快递单扫描识别软件 v8.1 简易版
评论
共有 条评论