当前位置: 首页 > news >正文

深圳网站建设 案例百度推广的几种方式

深圳网站建设 案例,百度推广的几种方式,察隅网站建设,建设一个门户网站价格由于项目中以一个环节需要使用kdtree ,对性能要求比较严苛#xff0c;所以看看那个kdtree效率高一些。对比了opencv和pcl。 #include array #include deque #include fstream #include opencv2/highgui.hpp #include opencv2/imgproc.hpp…由于项目中以一个环节需要使用kdtree ,对性能要求比较严苛所以看看那个kdtree效率高一些。对比了opencv和pcl。 #include array #include deque #include fstream #include opencv2/highgui.hpp #include opencv2/imgproc.hpp #include opencv2/flann.hpp#include pcl/point_types.h #include pcl/io/pcd_io.h #include pcl/kdtree/kdtree_flann.h#include iostream #include iostream #include cstdlib // 用于 rand() #include ctime // 用于 time()int main() {// 初始化随机种子std::srand(std::time(0));// 生成 5000 个随机的二维点int numPoints 5000;std::vectorcv::Point2f points;pcl::PointCloudpcl::PointXY::Ptr cloud(new pcl::PointCloudpcl::PointXY);// 随机生成点范围为 (-100, 100)for (int i 0; i numPoints; i) {float x static_castfloat(rand() % 200 - 100); // x 坐标在 [-100, 100] 范围内float y static_castfloat(rand() % 200 - 100); // y 坐标在 [-100, 100] 范围内points.push_back(cv::Point2f(x, y));cloud-points.push_back(pcl::PointXY(x, y));}// 2. 将点转换为 cv::Mat 格式cv::Mat pointMat(points.size(), 2, CV_32F); // 每个点是 2Dx, yfor (size_t i 0; i points.size(); i) {pointMat.atfloat(i, 0) points[i].x; pointMat.atfloat(i, 1) points[i].y;}// 3. 创建 KD-Tree 索引使用 FLANNcv::flann::Index kdtree(pointMat, cv::flann::KDTreeIndexParams(4)); // 4 表示树的分支数// 获取程序开始时的时钟时间std::clock_t start std::clock();for(int i 0 ;i 200; i){std::vectorint indices(1); // 最近邻的索引std::vectorfloat dists(1); // 最近邻的距离float x static_castfloat(rand() % 200 - 100); // x 坐标在 [-100, 100] 范围内float y static_castfloat(rand() % 200 - 100); // y 坐标在 [-100, 100] 范围内cv::Mat query (cv::Mat_float(1, 2) x, y);kdtree.knnSearch(query, indices, dists, 1, cv::flann::SearchParams(32));// std::cout Query point: query std::endl;// std::cout Closest point: pointMat.row(indices[0]) std::endl;// std::cout Distance: dists[0] std::endl;// std::cout ---------------- std::endl;}std::clock_t end std::clock();// 计算并输出经过的时间单位是秒double duration double(end - start) / CLOCKS_PER_SEC;std::cout opencv kdtree 搜索时间: duration 秒 std::endl;/pcl::KdTreeFLANNpcl::PointXY pcl_kdtree;pcl_kdtree.setInputCloud(cloud);start std::clock();for(int i 0 ;i 200; i){std::vectorint indices(1); // 最近邻的索引std::vectorfloat dists(1); // 最近邻的距离float x static_castfloat(rand() % 200 - 100); // x 坐标在 [-100, 100] 范围内float y static_castfloat(rand() % 200 - 100); // y 坐标在 [-100, 100] 范围内pcl::PointXY searchPoint;searchPoint.x x;searchPoint.y y;pcl_kdtree.nearestKSearch(searchPoint,1, indices, dists);// std::cout Query point: query std::endl;// std::cout Closest point: pointMat.row(indices[0]) std::endl;// std::cout Distance: dists[0] std::endl;// std::cout ---------------- std::endl;}end std::clock();// 计算并输出经过的时间单位是秒duration double(end - start) / CLOCKS_PER_SEC;std::cout pcl kdtree 搜索时间: duration 秒 std::endl;return 0; } CMakeLists.txt # 设置 CMake 最低版本要求 cmake_minimum_required(VERSION 3.10)# 设置项目名称 project(test_kdtree)# 查找 OpenCV 包 find_package(OpenCV REQUIRED) find_package(PCL REQUIRED)# 显示 OpenCV 的版本和路径 message(STATUS OpenCV version: ${OpenCV_VERSION}) message(STATUS OpenCV_INCLUDE_DIRS: ${OpenCV_INCLUDE_DIRS}) message(STATUS OpenCV_LIBS: ${OpenCV_LIBS})# 设置源文件 set(SOURCE_FILES test_kdtree.cpp)# 添加可执行文件 add_executable(${PROJECT_NAME} ${SOURCE_FILES})# 链接 OpenCV 库到目标程序 target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS} ${PCL_LIBRARIES})# 包含 OpenCV 的头文件路径 target_include_directories(${PROJECT_NAME} PRIVATE ${OpenCV_INCLUDE_DIRS}) 结果
http://www.dnsts.com.cn/news/3118.html

相关文章:

  • 做电商网站必需知道qc深圳广告公司排名
  • 团购产品 网站建设搜索引擎优化seo专员
  • 专门做外挂的网站推广恶意点击软件怎样使用
  • 怎么做才能设计出好的网站百度seo关键词排名优化工具
  • 罗湖网站建设的公司重庆seo网站哪家好
  • 怎做不下网站刷枪百度在线扫题入口
  • 重庆网站建设技术支持成人职业技术培训学校
  • 3d做网站seo培训网
  • 抖音seo工具上海seo网站推广
  • 做pc端网站教程百度分公司
  • 广州新塘建网站市场调研模板
  • 房地产设计网站软文发布平台排名
  • 九游下载安装载南宁百度seo排名价格
  • 如何引用网站图片长沙百度公司
  • c web网站开发实例网站推广系统方案
  • 用asp.net做网站的书谷歌seo网站排名优化
  • 做网站要考虑哪些因素视频号最新动作
  • 旅游网站开发毕业论文品牌推广和品牌营销
  • 那种登录才能查看的网站怎么做优化网站技术外包公司
  • 成都专业建站推广公司什么平台打广告比较好免费的
  • 网站如何做那种诱导广告爱站网长尾关键词挖掘工具
  • 上海网站建设沪icp备苏州百度推广公司
  • 用py做网站百度一下就知道官方网站
  • 华阴市住房和城乡建设局网站湖南企业seo优化推荐
  • 高端网站设计有哪些属于b2b的网站有哪些
  • 有没有专门学做婴儿衣服的网站seo快排
  • 金融企业网站建设百度投放广告一天多少钱
  • 新冠成都最新疫情厦门关键词优化平台
  • 水利部建设管理司网站媒体发稿公司
  • 电子信息工程网seo推广系统排名榜