data_def_api.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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;
  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. // rootstock grab based points cloud
  21. double rs_grab_xmin;
  22. double rs_grab_xmax;
  23. double rs_grab_ymin;
  24. double rs_grab_ymax;
  25. double rs_grab_zmin;
  26. double rs_grab_zmax;
  27. double rs_grab_zcent;
  28. double rs_grab_stem_diameter;
  29. double rs_grab_seedling_dist;
  30. int rs_grab_stem_min_pts;
  31. int rs_grab_seedling_min_pts;
  32. double rs_grab_ror_ratio;
  33. double rs_grab_fork_ratio;
  34. double rs_grab_offset;
  35. double rs_grab_fork_yup; //茎节高度上限
  36. double rs_grab_fork_ybt; //茎节高度下限, 不在范围内,按下限
  37. double rs_grab_offset_cut; // 在ybt、yup中间点进行偏移,在这个位置计算茎粗
  38. double rs_grab_fork_height; //茎节高度(最小值),毫米,小于此值不被识别
  39. int rs_grab_holes_number; //单排穴孔数量
  40. double rs_grab_valid_stem_ratio; //茎长度在视野高度上的占比阈值,小于此阈值,不被识别成茎
  41. double rs_grab_valid_occlusion_ratio;//遮挡物在视野高度上的占比阈值,小于此阈值,不被识别成遮挡物
  42. double rs_grab_valid_overall_ratio;//茎+叶子在视野高度上的占比阈值,小于此阈值,不被识别
  43. // scion grab based points cloud
  44. double sc_grab_xmin;//单排穴孔外沿
  45. double sc_grab_xmax;//单排穴孔外沿
  46. double sc_grab_ymin;
  47. double sc_grab_ymax;
  48. double sc_grab_zmin;
  49. double sc_grab_zmax;
  50. double sc_grab_zcent;
  51. double sc_grab_stem_diameter;
  52. double sc_grab_seedling_dist;
  53. int sc_grab_stem_min_pts;
  54. int sc_grab_seedling_min_pts;
  55. double sc_grab_ror_ratio;
  56. double sc_grab_fork_ratio;
  57. double sc_grab_offset_nofork; //无茎节的偏移量
  58. double sc_grab_offset_up; //茎节在yup以上的偏移量
  59. double sc_grab_offset_bt; //茎节在ybt以下的偏移量
  60. double sc_grab_offset_normal; //茎节在ybt以上yup以下的偏移量
  61. double sc_grab_fork_yup; //茎节高度上限
  62. double sc_grab_fork_ybt; //茎节高度下限, 不在范围内,按下限
  63. double sc_grab_offset_cut; // 在ybt、yup中间点进行偏移,在这个位置计算茎粗
  64. double sc_grab_fork_height; //茎节高度(最小值),毫米,小于此值不被识别
  65. int sc_grab_holes_number; //单排穴孔数量
  66. double sc_grab_valid_stem_ratio;
  67. double sc_grab_valid_occlusion_ratio;
  68. double sc_grab_valid_overall_ratio;//茎+叶子在视野高度上的占比阈值,小于此阈值,不被识别
  69. } ConfigParam;
  70. typedef struct
  71. {
  72. //以下涉及到位置均为实际位置,毫米
  73. double rs_grab_x;//砧木上苗抓取位置x,毫米
  74. double rs_grab_y;//砧木上苗抓取位置y,毫米
  75. double rs_grab_z;//砧木上苗抓取位置z,毫米
  76. double rs_fork_y1;//砧木上苗茎节1的y坐标,毫米, 等于-1000表示不存在
  77. double rs_fork_y2;//砧木上苗茎节2的y坐标,毫米, 等于-1000表示不存在
  78. double rs_fork_y3;//砧木上苗茎节2的y坐标,毫米, 等于-1000表示不存在
  79. double rs_width; //茎的宽度(直径),毫米
  80. double rs_tortuosity; //弯曲度,离茎中心轴线最大距离,毫米
  81. double rs_count; //当前第一排共有多少株
  82. double sc_grab_x;//穗苗上苗抓取位置x,毫米
  83. double sc_grab_y;//穗苗上苗抓取位置y,毫米
  84. double sc_grab_z;//穗苗上苗抓取位置z,毫米
  85. double sc_width; //茎的宽度(直径),毫米
  86. double sc_tortuosity; //弯曲度,离茎中心轴线最大距离,毫米
  87. double sc_count; //当前第一排共有多少株
  88. ImgInfo* pp_images[5];//参考图片,只读,从前向后,没有的会被置零
  89. }PositionInfo;
  90. };