Explorar o código

v0.6.5 抓取最左侧一株苗

chenhongjiang hai 1 ano
pai
achega
37fe644e31
Modificáronse 3 ficheiros con 5 adicións e 4 borrados
  1. 2 1
      ReadMe.txt
  2. 2 2
      grab_point_rs.cpp
  3. 1 1
      graft_cv_api.cpp

+ 2 - 1
ReadMe.txt

@@ -72,4 +72,5 @@ v0.6.0 
 v0.6.1 移植到vs2015平台(vc14),选用OpenCV v4.55
 v0.6.2 增加上苗点云识别夹取位置接口及功能
 v0.6.3 增加茄科切后识别接口及功能(同一个接口支持砧木和穗苗)
-v0.6.4 增加算法参数读取文件进行更新的接口
+v0.6.4 增加算法参数读取文件进行更新的接口
+v0.6.5 修改代码,得到最左侧一株

+ 2 - 2
grab_point_rs.cpp

@@ -321,13 +321,13 @@ namespace graft_cv {
 			m_pLogger->INFO(buff.str());
 		}
 
-		//sort cluster center, get the frontest rightest one
+		//sort cluster center, get the frontest leftest one
 		std::vector<float> cluster_index;
 		for (auto&pt : cluster_center) {
 			float idx = pt.x - pt.z;
 			cluster_index.push_back(idx);
 		}
-		int first_idx = std::max_element(cluster_index.begin(), cluster_index.end()) - cluster_index.begin();
+		int first_idx = std::min_element(cluster_index.begin(), cluster_index.end()) - cluster_index.begin();
 
 		first_seedling_cloud_idx.clear();
 		for (auto&v : cluster_member[first_idx]) {

+ 1 - 1
graft_cv_api.cpp

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