【问题标题】:Creating a GUI for Point Cloud Visualization为点云可视化创建 GUI
【发布时间】:2018-05-29 18:50:05
【问题描述】:

我有一个非常简单的工具,可以使用 Opencv 在线可视化激光雷达传感器数据。我想为它创建一个 GUI,但我是该地区的菜鸟。对材料或示例有什么建议吗? GUI 现在只需要做两件事:

  1. 通过 LAN 端口将传感器数据作为输入。
  2. 可视化它。

这是我根据一些 YouTube 视频得出的结论。我应该如何进行?

private: int Display_Point_Cloud() {
  // Create Viewer
  cv: :viz::Viz3d viewer("Velodyne");
  const boost: :asio::ip::address address=boost::asio::ip::address::from_string("192.168.1.77");
  const unsigned short port=2368;
  velodyne: :VLP16Capture capture(address, port);
  std: :vector<velodyne::Laser> lasers;
  capture>>lasers;
  std: :vector<cv::Vec3f> buffer (lasers.size());
  for (const velodyne: :Laser& laser: lasers) {
    const double distance=static_cast<double>(laser.distance);
    const double azimuth=laser.azimuth * CV_PI / 180.0;
    const double vertical=laser.vertical * CV_PI / 180.0;
    float x=static_cast<float>((distance * std: :cos(vertical)) * std::sin(azimuth));
    float y=static_cast<float>((distance * std: :cos(vertical)) * std::cos(azimuth));
    float z=static_cast<float>((distance * std: :sin(vertical)));
    if (x==0.0f && y==0.0f && z==0.0f) {
      x=std: :numeric_limits<float>::quiet_NaN();
      y=std: :numeric_limits<float>::quiet_NaN();
      z=std: :numeric_limits<float>::quiet_NaN();
    }
    buffer.push_back(cv::Vec3f(x, y, z));
  }
  // Create Widget
  cv::Mat cloudMat=cv::Mat(static_cast<int>(buffer.size()), 1, CV_32FC3, &buffer[0]);
  cv::viz::WCloud cloud(cloudMat);
  // Show Point Cloud
  viewer.showWidget("Cloud", cloud);
  viewer.spinOnce();
  // Close All Viewers
  cv::viz::unregisterAllWindows();
  return 0;
}

private: System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e) {}

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
  Display_Point_Cloud();
}


}
;

【问题讨论】:

  • 寻求问题的解决方案已降级,请尝试在此处展示您的代码,然后就问题寻求帮助。
  • 现在添加了我的代码。希望对你有帮助
  • 我对激光雷达一无所知,但我做了一些搜索,希望下面的链接可以帮助你。 paraview.org/veloviewmidas3.kitware.com/midas/community/29

标签: visual-studio user-interface lidar


【解决方案1】:

试试 VTK。 https://www.vtk.org/ 我将它用于我的工作,它可以在 opencv 支持下进行编译。

【讨论】:

    猜你喜欢
    • 2017-03-11
    • 1970-01-01
    • 2012-04-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多