WaferRebuild.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef WAFERREBUILD_H
  2. #define WAFERREBUILD_H
  3. #ifdef _EXPORTING
  4. #define API_DECLSPEC __declspec(dllexport)
  5. #else
  6. #define API_DECLSPEC __declspec(dllimport)
  7. #endif
  8. #include <vector>
  9. #include <string>
  10. #include <tuple>
  11. #include "math_tool.h"
  12. #include "image.h"
  13. #include "cloud_point.h"
  14. #include "nlohmann/json.hpp"
  15. class ArithPmd;
  16. class API_DECLSPEC WaferRebuild
  17. {
  18. public:
  19. WaferRebuild();
  20. ~WaferRebuild();
  21. private:
  22. ArithPmd* arith_pmd;
  23. public:
  24. /*
  25. * @brief 初始化
  26. *
  27. * @param[in] param 算法参数(json格式, 包含相机标定矩阵)
  28. * @return 错误码
  29. */
  30. std::tuple<int, std::string> initParam(const nlohmann::json& param);
  31. /*
  32. * @brief 计算一台相机点云,可并发
  33. *
  34. * @param[in] image_list 一台相机的图像
  35. * @param[out] cloud_points 点云
  36. * @param[in] camera_index 相机id(0 , 1 , 2 , 3)
  37. * @return 错误码
  38. */
  39. std::tuple<int, std::string> calcCloud(const std::vector<std::shared_ptr<infra::Image>>& image_list, std::shared_ptr<infra::CloudPoint<double>>& cloud_points, int32_t camera_index);
  40. /*
  41. * @brief 合并点云
  42. *
  43. * @param[in] cloud_points_list 相机id(0 , 1 , 2 , 3) 和 相机对应点云
  44. * @param[out] cloud_points 四台相机合并后的点云
  45. * @return 错误码
  46. */
  47. std::tuple<int, std::string> mergeCloud(const std::map<int32_t, std::shared_ptr<infra::CloudPoint<double>>>& cloud_points_list,
  48. std::shared_ptr<infra::CloudPoint<double>>& cloud_points);
  49. /*
  50. * @brief 翘曲测量
  51. *
  52. * @param[in] cloud_points 合并后的点云
  53. * @param[in] filterMM 过滤尺寸
  54. * @param[out] result 测量结果(json格式),如result
  55. * @return 错误码
  56. */
  57. std::tuple<int, std::string> warpage(const std::shared_ptr<infra::CloudPoint<double>>& cloud_points, int32_t filterMM, nlohmann::json& result);
  58. };
  59. #endif // WAFERREBUILD_H