data_def_api.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #pragma once
  2. #include <string>
  3. namespace graft_cv{
  4. typedef unsigned char byte;
  5. typedef struct
  6. {
  7. int channel;
  8. int width;
  9. int height;
  10. byte *data; // 长度:width * height * channel
  11. }ImgInfo;
  12. typedef struct{
  13. // 调试控制 (2)
  14. bool image_show;//true--显示处理过程中的中间图片,需要人工回车才能继续执行; false--无图片显示
  15. bool image_return;//true--返回结果positoninfo中添加返回的图片; false--无图片返回
  16. //image storage parameters(3)
  17. bool image_save;//是否保存图像
  18. std::string image_depository;//保存图像目录
  19. int image_backup_days;//保存图像天数,过期删除
  20. std::string model_path_grab;
  21. float object_threshold_grab;
  22. float nms_threshold_grab;
  23. int grid_row_grab;
  24. int grid_col_grab;
  25. int grid_padding_grab;
  26. int offset_grab; //抓取点相对参考点(标注的点5)的偏移像素数
  27. double min_distance_grab;//抓取两个目标最小中心距离,像素距离
  28. double min_area_ratio_grab; //识别目标最小面积比率,最小面积和整个图的面积比
  29. double max_area_ratio_grab; //识别目标最大面积比率,最大面积和整个图的面积比
  30. double rot_degree_grab;
  31. std::string model_path_cut;
  32. float object_threshold_cut;
  33. float nms_threshold_cut;
  34. int grid_row_cut;
  35. int grid_col_cut;
  36. int grid_padding_cut;
  37. double min_area_ratio_cut;
  38. double max_area_ratio_cut;
  39. double kp3_weight_cut; //关键点kp3权重,[0,1]内,切割点在关键点kp3、kp2间,此值越大越靠近kp3点
  40. } ConfigParam;
  41. typedef struct
  42. {
  43. //以下涉及到位置均为实际位置
  44. double tea_grab_x1; //第一株茶叶抓取位置x1,//以下为tcd
  45. double tea_grab_y1; //第一株茶叶抓取位置y1,
  46. double tea_grab_angle1; //第一株茶叶抓取角度r1,
  47. double tea_grab_x2; //第二株茶叶抓取位置x2,
  48. double tea_grab_y2; //第二株茶叶抓取位置y2,
  49. double tea_grab_angle2; //第二株茶叶抓取角度r2,
  50. double tea_cut_x1; //第一株茶叶切割位置x1,
  51. double tea_cut_y1; //第一株茶叶切割位置y1,
  52. double tea_cut_angle1; //第一株茶叶切割角度r1,
  53. double tea_cut_x2; //第二株茶叶切割位置x2,
  54. double tea_cut_y2; //第二株茶叶切割位置y2,
  55. double tea_cut_angle2; //第二株茶叶切割角度r2,
  56. ImgInfo* pp_images[5];//参考图片,只读,从前向后,没有的会被置零
  57. }PositionInfo;
  58. };