Przeglądaj źródła

v0.7.15 优化茎节位置识别

chenhongjiang 1 rok temu
rodzic
commit
53bbd0e514
4 zmienionych plików z 40 dodań i 16 usunięć
  1. 2 1
      ReadMe.txt
  2. 27 12
      gcv_conf.yml
  3. 10 2
      grab_point_rs.cpp
  4. 1 1
      graft_cv_api.cpp

+ 2 - 1
ReadMe.txt

@@ -99,4 +99,5 @@ v0.7.10 
 v0.7.11 增加棋盘格识别,用于标定辅助
 v0.7.12 增加茎节peakfind功能
 v0.7.13 修改sc_grab_offset不起作用的bug
-v0.7.14 增加指定抓取位置的功能,抓取位置在ymax向下指定距离为抓取位置
+v0.7.14 增加指定抓取位置的功能,抓取位置在ymax向下指定距离为抓取位置
+v0.7.15 优化茎节位置识别

+ 27 - 12
gcv_conf.yml

@@ -65,22 +65,37 @@ conf_parameters:
    rs_oa_pixel_ratio: 2.3333300000000001e-001
    rs_cut_pixel_ratio: 5.8479999999999997e-002
    sc_cut_pixel_ratio: 8.7499999999999994e-002
-   rs_grab_xmin: -100
+   # rs_grab_xmin: -100
+   # rs_grab_xmax: 250
+   # rs_grab_ymin: -45
+   # rs_grab_ymax: 0
+   # rs_grab_zmin: 300
+   # rs_grab_zmax: 400
+   # rs_grab_stem_diameter: 5.0
+   # rs_grab_y_opt: -30
+   # rs_grab_seedling_dist: 40.0
+   # rs_grab_stem_min_pts: 50
+   # rs_grab_ror_ratio: 0.8
+   # rs_grab_offset: -5.0
+
+   rs_grab_xmin: -200
    rs_grab_xmax: 250
-   rs_grab_ymin: -45
-   rs_grab_ymax: 0
+   rs_grab_ymin: -30
+   rs_grab_ymax: 10
    rs_grab_zmin: 300
-   rs_grab_zmax: 400
+   rs_grab_zmax: 440
    rs_grab_stem_diameter: 5.0
-   rs_grab_y_opt: -30
+   rs_grab_y_opt: 20
    rs_grab_seedling_dist: 40.0
    rs_grab_stem_min_pts: 50
-   rs_grab_ror_ratio: 0.8
-   rs_grab_offset: -5.0
-   sc_grab_xmin: -100
-   sc_grab_xmax: 220
+   rs_grab_ror_ratio: 0.85
+   rs_grab_offset: .0
+
+
+   sc_grab_xmin: -200
+   sc_grab_xmax: 200
    sc_grab_ymin: -30
-   sc_grab_ymax: 15
+   sc_grab_ymax: 10
    sc_grab_zmin: 300
    sc_grab_zmax: 400
    #sc_grab_xmin: -30
@@ -90,10 +105,10 @@ conf_parameters:
    #sc_grab_zmin: 420
    #sc_grab_zmax: 550   
    sc_grab_stem_diameter: 5.0
-   sc_grab_y_opt: -20
+   sc_grab_y_opt: 30
    sc_grab_seedling_dist: 40.0
    sc_grab_stem_min_pts: 45
    sc_grab_ror_ratio: 0.85
-   sc_grab_offset: -37.0
+   sc_grab_offset: 0
    
 

+ 10 - 2
grab_point_rs.cpp

@@ -2441,8 +2441,16 @@ void CRootStockGrabPoint::line_filter(
 		std::vector<int> peak_indices;
 		findPeaks(stem_width, peak_indices, false);
 		if(peak_indices.size() > 0) {
-			max_pos = peak_indices[0];
-			max_pos_ref = max_pos;
+			int tmp_max_pos = peak_indices[0];
+			float max_v = stem_width[tmp_max_pos];
+			for (auto&pid : peak_indices) {
+				if (stem_width[pid] > max_v) {
+					tmp_max_pos = pid;
+					max_v = stem_width[tmp_max_pos];
+				}
+			}
+			max_pos = tmp_max_pos;
+			max_pos_ref = max_pos;			
 		}
 		float max_val = stem_width.at(max_pos);
 		float th = mu + th_ratio * stdv;

+ 1 - 1
graft_cv_api.cpp

@@ -20,7 +20,7 @@ extern CRITICAL_SECTION g_cs;
 namespace graft_cv
 {
 
-	char *g_version_str = "0.7.14";
+	char *g_version_str = "0.7.15";
 
 	//configure
 	string g_conf_file = "./gcv_conf.yml";