pcl

PCL行人检测

混江龙づ霸主 提交于 2019-12-18 13:47:56
首先我们知道 Hog特征结合 SVM分类器已经被广泛应用于图像识别中,尤其在行人检测中获得了极大的成功 ,HOG+SVM进行行人检测的方法是法国研究人员 Dalal在 2005的 CVPR上提出的,而如今虽然有很多行人检测算法不断提出,但基本都是以 HOG+SVM的思路为主,那么PCL中也是利用这一思想来进行行人的检测, 总体思路: 1、提取正负样本hog特征 2、投入svm分类器训练,得到model 3、由model生成检测子 4、利用检测子检测负样本,得到hardexample 5、提取hardexample的hog特征并结合第一步中的特征一起投入训练,得到最终检测子。 首先整合一下理论知识 HOG特征: 方向梯度直方图( Histogram of Oriented Gradient, HOG)特征是一种在计算机视觉和图像处理中用来进行物体检测的特征描述子。它通过计算和统计图像局部区域的梯度方向直方图来构成特征。 具体的是实现方法: 首先将图像分成小的连通区域,我们把它叫细胞单元。然后采集细胞单元中各像素点的梯度的或边缘的方向直方图。最后把这些直方图组合起来就可以构成特征描述器。 提高性能: 把这些局部直方图在图像的更大的范围内(我们把它叫区间或 block)进行对比度归一化( contrast-normalized),所采用的方法是:先计算各直方图在这个区间( block

关于测试pcl库遇到的问题和cmake制定C++标准的问题

守給你的承諾、 提交于 2019-12-17 08:48:31
本人第一次安装pcl库,在安装过程中,基本没有什么大问题,并且成功make && make install,但是在网上找程序进行pcl测试的时候,通过CMakeLists.txt文件进行了编译,然后make的时候一直报错,如下: /usr/include/pcl-1.9/pcl/register_point_struct.h:97:10: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type std::enable_if_t<!std::is_array<T>::value> /usr/include/pcl-1.9/pcl/impl/point_types.hpp:1696:25: error: use of ‘auto’ in lambda parameter declaration only available with -std=c++14 or -std=gnu++14 error: ‘type’ is not a member of ‘pcl::traits::datatype<pcl::_RGB, pcl::fields::rgba> /usr/include/pcl-1.9/pcl/point_types.h:365:1: error: ‘plus’ is not a member

PCL拾取屏幕上三维点坐标

杀马特。学长 韩版系。学妹 提交于 2019-12-11 08:20:31
PCL中通过注册回调函数实现点云坐标选取。主要使用的函数: registerPointPickingCallback() PCL官方代码: http://www.pointclouds.org/documentation/tutorials/ground_based_rgbd_people_detection.php 主要实现代码如下: #include <pcl\io\pcd_io.h> #include <pcl\point_cloud.h> #include <pcl\point_types.h> #include <pcl\visualization\pcl_visualizer.h> boost::mutex cloud_mutex; //定义回调参数结构体 struct callback_args{ // structure used to pass arguments to the callback function PointCloudT::Ptr clicked_points_3d; pcl::visualization::PCLVisualizer::Ptr viewerPtr; }; // 回调处理事件 这里是点选取事件 void pp_callback(const pcl::visualization::PointPickingEvent& event,

Cmake编译PCL以及VS调试

痴心易碎 提交于 2019-12-10 11:14:38
使用Cmake编译程序 写在前头:本人是PCL小白,刚开始编译的时候,遇到很多问题,一开始在VS2017上直接配置PCL,遇到各种杂七杂八的bug,最后听从前人指导,说可以使用Cmake去编译程序,之前从未使用过Cmake,这次也只是浅浅的使用了一下,记录下来,一来是为了记录自己的成长,二来是分享给更多的人,共同交流学习~ 我的配置是:64位win7旗舰版电脑、3.16.0的Cmake,1.9.1的PCL,以下是我的网盘链接(官网下载太慢了): PCL链接:https://pan.baidu.com/s/1Q7Wq60HC-lxA2lFXBDOwpw 提取码:em7w Cmake链接:https://pan.baidu.com/s/1ZL4B8VIpIU3JFQJUImiNZA 提取码:wv3z 1.新建三个文件,如下图所示: 2.三个文件的内容分别如下: (1)CMakeList.txt cmake_minimum_required ( VERSION 2.8 FATAL_ERROR ) project ( Kd_tree ) find_package ( PCL 1.2 REQUIRED ) include_directories ( $ { PCL_INCLUDE_DIRS } ) link_directories ( $ { PCL_LIBRARY_DIRS } ) add

txt点云转pcd、设定高程范围滤波及屏幕三维点坐标拾取

て烟熏妆下的殇ゞ 提交于 2019-12-10 08:00:01
下午闲来无事,在网上找了几个pcl点云的教程,简单拼凑,做了一点儿小功能,希望能对您有所启发! 主要功能为: (1)将txt格式的点云转化为pcd格式的点云 (2)根据设定的高程阈值,即Z字段,将范围之内的点坐标滤掉 (3)从滤波后的点云可视化结果中,获取鼠标点击位置的三维点坐标,将其打印在控制台 1 txt点云转pcd点云 ///------------------------------点云数据的格式转化模块------------------------------ //函数功能:将如下格式的txt点云转换为pcd点云 /* PointNum: 13346 X Y Z Intensity ClassType ReturnNumberType 437354.62000000 2557954.96980469 -3.51999817 1476 2 */ //函数参数:txtPath txt点云文件路径 //函数参数:pcdPath pcd点云的文件路径 bool txt2pcd(string txtPath, string pcdPath) { ifstream in; in.open(txtPath); string widthLine; getline(in, widthLine); //第一行标记了点云的行数,以字符串形式读入然后再转化为数值 string width =

PCL 点云欧式聚类

天涯浪子 提交于 2019-12-09 13:53:06
#include <pcl/ModelCoefficients.h> #include <pcl/point_types.h> #include <pcl/io/pcd_io.h> #include <pcl/filters/extract_indices.h> #include <pcl/filters/voxel_grid.h> #include <pcl/features/normal_3d.h> #include <pcl/kdtree/kdtree.h> #include <pcl/sample_consensus/method_types.h> #include <pcl/sample_consensus/model_types.h> #include <pcl/segmentation/sac_segmentation.h> #include <pcl/segmentation/extract_clusters.h> #include <pcl/visualization/pcl_visualizer.h> int main(int argc, char** argv) { // Read in the cloud data pcl::PCDReader reader; pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl

PCL 点云库 点云 凸包检测 Convex Hull 凸包顶点求解

守給你的承諾、 提交于 2019-12-07 17:17:15
点云凸包检测还是比较常用的,PCL自带的凸包检测 ConvexHull ,这个函数比较简单,设置凸包维度 setDimension即可,在这里记录一下 头文件:#include <pcl/surface/convex_hull.h> pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>); pcl::io::loadPCDFile<pcl::PointXYZ>("bun_45.pcd", *cloud); pcl::ConvexHull<pcl::PointXYZ> hull; hull.setInputCloud(cloud); hull.setDimension(3); std::vector<pcl::Vertices> polygons; pcl::PointCloud<pcl::PointXYZ>::Ptr surface_hull(new pcl::PointCloud<pcl::PointXYZ>); hull.reconstruct(*surface_hull, polygons); cout << surface_hull->size() << endl; // ---------------------- Visualizer ------------------

PCL1.8.1 获取点云中的最大和最小的xyz值

浪子不回头ぞ 提交于 2019-12-06 08:08:03
getMinMax3D 该函数输入点云数据,将所有x y z中最小的值和x y z中最大的值输出到pcl::PointXYZ中。 #include <pcl/common/common.h> int main() { pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>); // Fill in the cloud data cloud->width = 15; cloud->height = 1; cloud->points.resize(cloud->width * cloud->height); // Generate the data for (std::size_t i = 0; i < cloud->points.size(); ++i) { cloud->points[i].x = 1024 * rand() / (RAND_MAX + 1.0f); cloud->points[i].y = 1024 * rand() / (RAND_MAX + 1.0f); cloud->points[i].z = rand(); } for (std::size_t i = 0; i < cloud->points.size(); ++i) { std::cout << " " <

PCL1.8.1 分割 - ModelOutlierRemoval

放肆的年华 提交于 2019-12-06 04:16:15
ModelOutlierRemoval 基于模型的点分割操作,将模型外的点从点云中剔除。 #include <iostream> #include <pcl/point_types.h> #include <pcl/filters/model_outlier_removal.h> pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>); pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_sphere_filtered (new pcl::PointCloud<pcl::PointXYZ>); //x^2 + y^2 + z^2 = 1 pcl::ModelCoefficients sphere_coeff; sphere_coeff.values.resize (4); sphere_coeff.values[0] = 0; sphere_coeff.values[1] = 0; sphere_coeff.values[2] = 0; sphere_coeff.values[3] = 1; pcl::ModelOutlierRemoval<pcl::PointXYZ> sphere_filter; sphere_filter

PCL1.8.1 多个分割点云的保存

徘徊边缘 提交于 2019-12-06 02:37:02
std::vector <pcl::PointIndices> 在使用分割算法分割点云时,会生成多个pcl::PointIndices,通常会保存在std::vector中,以下分割算法会生成多个pcl::PointIndices: std::vector<pcl::PointIndices> cluster_indices; //欧式聚类分割 pcl::EuclideanClusterExtraction<pcl::PointXYZ> ec; ec.extract (cluster_indices); //区域增长分割 pcl::RegionGrowing<pcl::PointXYZ, pcl::Normal> reg; reg.extract (cluster_indices); 保存pcl::PointIndices到文件的代码实现如下: #include <pcl/io/pcd_io.h> #include <pcl/filters/extract_indices.h> //输入点云 pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_filtered (new pcl::PointCloud<pcl::PointXYZ>); //保存分割后的点云索引组 std::vector<pcl::PointIndices> cluster