在点云库(PCL)中设置ISSKeypoint3D的法线(Setting normals for ISSKeypoint3D in Point Cloud Library (PCL))
我正在尝试在PCL中的点云上计算ISS3D关键点。 我想设置法线,因为我不确定ISS关键点估计是否以正确的方向翻转它们。 但是,当我尝试设置这样的法线时
typedef pcl::PointCloud<pcl::PointXYZRGB> > PointCloud; PointCloud::Ptr detecISSKeypoints(PointCloud::Ptr cloud, pcl::PointCloud<pcl::PointNormal>::Ptr normals, float resolution) { pcl::PointCloud<pcl::PointXYZRGB>::Ptr keypoints(new pcl::PointCloud<pcl::PointXYZRGB>); pcl::ISSKeypoint3D<pcl::PointXYZRGB, pcl::PointXYZRGB> detector; detector.setInputCloud(cloud); detector.setNormals(normals); pcl::search::KdTree<pcl::PointXYZRGB>::Ptr kdtree(new pcl::search::KdTree<pcl::PointXYZRGB>); detector.setSearchMethod(kdtree); detector.setSalientRadius(6 * resolution); detector.setNonMaxRadius(6 * resolution); detector.setMinNeighbors(6); detector.setThreshold21(0.975); detector.setThreshold32(0.975); detector.setNumberOfThreads(4); detector.compute(*keypoints); return keypoints; }
我得到一个错误,
setNormals
期待一个const PointCloudNConstPtr&
。 我试图将法线的指针转换为const pcl::PointCloud<pcl::PointNormal>::ConstPtr
,但是这不起作用。我该如何设置法线?
I'm trying to compute ISS3D keypoints on a point cloud in PCL. I want to set the normals because I'm not sure if the ISS keypoint estimation flips them in the correct direction. However, when I try to set the normals like this
typedef pcl::PointCloud<pcl::PointXYZRGB> > PointCloud; PointCloud::Ptr detecISSKeypoints(PointCloud::Ptr cloud, pcl::PointCloud<pcl::PointNormal>::Ptr normals, float resolution) { pcl::PointCloud<pcl::PointXYZRGB>::Ptr keypoints(new pcl::PointCloud<pcl::PointXYZRGB>); pcl::ISSKeypoint3D<pcl::PointXYZRGB, pcl::PointXYZRGB> detector; detector.setInputCloud(cloud); detector.setNormals(normals); pcl::search::KdTree<pcl::PointXYZRGB>::Ptr kdtree(new pcl::search::KdTree<pcl::PointXYZRGB>); detector.setSearchMethod(kdtree); detector.setSalientRadius(6 * resolution); detector.setNonMaxRadius(6 * resolution); detector.setMinNeighbors(6); detector.setThreshold21(0.975); detector.setThreshold32(0.975); detector.setNumberOfThreads(4); detector.compute(*keypoints); return keypoints; }
I get an error that
setNormals
is expecting aconst PointCloudNConstPtr&
. I tried to convert the pointer of the normals toconst pcl::PointCloud<pcl::PointNormal>::ConstPtr
, however this didn't work.How can I set the normals?
原文:https://stackoverflow.com/questions/35893197
最满意答案
你希望sqlite替换
.
按当前文件夹路径。 但它没有提供此功能。 您可以改为提供完整路径import os SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) DB_PATH = SCRIPT_DIR + '/data/sources.db' ... con = sqlite3.connect(DB_PATH, detect_types = sqlite3.PARSE_DECLTYPES, timeout = 10)
如果文件/表之前不存在,您应该简单地执行一种数据库初始化来创建表。 但这只不过是
CREATE TABLE
语句CREATE TABLE sources (...) VALUES ();
You expect sqlite to replace the
.
by the current folder path. But it doesn't provide this feature. You can instead provide the full pathimport os SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) DB_PATH = SCRIPT_DIR + '/data/sources.db' ... con = sqlite3.connect(DB_PATH, detect_types = sqlite3.PARSE_DECLTYPES, timeout = 10)
If the file/table did not exist before, you should simply perfom a kind of database initilization to create the table. But this would be nothing more than the
CREATE TABLE
statementCREATE TABLE sources (...) VALUES ();
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
您使用存储过程是错误的。 在第一个屏幕截图上有一个记录集,但在执行exec @File=[dbo].[MySp]你没有变量@File的记录集。 你得到了 @return_status 在@File @return_status是一个可选的整数变量,用于存储模块的返回状态。 必须在批处理,存储过程或函数中声明此变量,然后才能在EXECUTE语句中使用它。 正确的查询可以是这样的: declare @File as varbinary(max) DECLARE @Table TABLE ( plot ...
-
如何在带有字符串主键的表上执行`INSERT INTO`?(How can I execute an `INSERT INTO` on a table with a string primary key?)[2022-03-07]
你可以在你的ID中插入一个UUID(就像一个GUID)......它保证是唯一的。 遗憾的是,加载模块有点复杂: 在Postgres中为Insert语句生成UUID? 啊......还有什么是wildplasser说的,+ 1! :-) You could insert a UUID (it's like a GUID) in your ID... It's guaranteed to be unique. Sadly it's a little complex to load the module: Ge ... -
你也可以使用sys对象来获得你的优势: INSERT INTO table1(n) SELECT TOP 10000 ROW_NUMBER() OVER(ORDER BY a.object_id) AS n FROM sys.objects a CROSS JOIN sys.objects b GO Also you can use sys objects to your advantage: INSERT INTO table1(n) SELECT TOP 10000 ROW_NUMBER() OVER ...
-
执行root命令,没有root用户避免密码提示(Execute root command with no root user avoiding password prompt)[2022-03-18]
如果您只需要root权限来运行chown ,那么就不需要赋予整个脚本root权限。 放在脚本中: sudo chown -R apache:apache /var/www/html/my/data 并且, 使用 sudoedit ,添加以下行: marco ALL=(ALL:ALL) NOPASSWD:chown -R apache:apache /var/www/html/my/data If you only need root permission to run chown, then there ... -
或者在同一个语句中运行它们(用分号分隔单独的命令)或者使用事务,以便在第二个语句失败时可以回滚第一个语句。 Either run them both in the same statement (separate the separate commands by a semi-colon) or a use a transaction so you can rollback the first statement if the 2nd fails.
-
你需要执行这样的事情: echo "