我已经使用./vcpkg install pcl:x64-windows用vcpkg安装了PCL。
过了一会儿,我注意到concave_hull.h、convex_hull.h和qhull.h没有与库的其余部分一起安装。
关于我正在工作的更多信息:
(2020.11.01)
为了完成任务,我已经包含了导致这个问题的代码:
#include <pcl/surface/concave_hull.h>
#include <pcl/point_cloud.h>
int main()
{
using point_cloud_colored = pcl::PointCloud<pcl::PointXYZRGB>;
//plane is generated from somewhere else and is not important for this issue
point_cloud_colored::Ptr plane = load_cloud_from_somewhere();
point_cloud_colored::Ptr hull_cloud(new point_cloud_colored);
pcl::ConcaveHull<point_cloud_colored> chull;
chull.setInputCloud(plane);
chull.setAlpha(0.1);
chull.reconstruct(*hull_cloud);
}此代码产生以下错误消息:
严重程度代码描述项目文件行抑制状态错误C1083 不能打开包含文件:'pcl/surface/concave_hull.h':没有这样的文件或目录 farrao_gui C:\Users\ ...\farrao\source\farrao_gui\farrao_gui.cpp 39
我已经尝试通过vcpkg重新安装,但是没有成功。
有办法解决这个问题吗?
发布于 2021-03-11 09:44:55
过了一段时间,我按照这个指南:http://www.qhull.org/html/README_r.txt切换到可重入的qhull版本,从而解决了这个问题。
您必须将concave_hull代码复制到您自己的项目中的文件(hpp、h和cpp)中。
修复头并删除每个文件中的#ifdef HAVE_QHULL,并在hpp文件中添加这段代码:
extern "C"
{
#include <libqhull_r/qhull_ra.h>
qhT qh_qh;
qhT* qh = &qh_qh;
}之后:
通过每个qh->
qh
qh指针作为第一个参数(如果necessary)
FOREACHvertex_i_ Makro并添加qh作为第一个参数)
这可能不是最好的解决方案,因为这个问题远远超出我的范围,但算法确实产生了结果。它还可以使用凸算法(因为它也不包含在vcpkg安装中)。
我希望这个答案能对有类似问题的人有所帮助。
https://stackoverflow.com/questions/66546051
复制相似问题