diff --git a/JPEGImages/13.jpg b/JPEGImages/13.jpg index e375ec5..7ac8c6b 100644 Binary files a/JPEGImages/13.jpg and b/JPEGImages/13.jpg differ diff --git a/QT.py b/QT.py index 21d2dc7..c1327fb 100755 --- a/QT.py +++ b/QT.py @@ -291,19 +291,19 @@ def setupUi(self, MainWindow): print("\033[0;32m相机初始化完成\033[0m") self.thread_init() print("\033[0;32m多线程初始化完成\033[0m") - # self.names.append("ZA001") # 舒肤佳 + self.names.append("ZA001") # 舒肤佳 # self.names.append("ZA001v") - # self.names.append("ZA001h1") + self.names.append("ZA001h1") # self.names.append("ZA001h2") # self.names.append("ZA002") # 洗手液 # self.names.append("ZA003") # 牙膏 - # self.names.append("ZA004") # 花露水 + self.names.append("ZA004") # 花露水 # self.names.append("ZA005") # 鸭子 - # self.names.append("ZB001") # 八宝粥 + self.names.append("ZB001") # 八宝粥 # self.names.append("ZB002") # 辣酱 # self.names.append("ZB003") # 曲奇 # self.names.append("ZB004") # 果珍 - self.names.append("ZB005") # 绿箭 + # self.names.append("ZB005") # 绿箭 # self.names.append("ZB006") # 面 # self.names.append("ZB006r") # self.names.append("ZB007") # 太平饼干 @@ -313,7 +313,7 @@ def setupUi(self, MainWindow): # self.names.append("ZB009r") # self.names.append("ZB010") # 瓜子 # self.names.append("ZC004") # 红牛 - # self.names.append("ZC005") # AD奶 + self.names.append("ZC005") # AD奶 # self.names.append("ZC006") # 橙汁 # self.names.append("ZC008") # 加多宝 # self.names.append("ZC009") # 冰红茶 @@ -323,8 +323,8 @@ def setupUi(self, MainWindow): # self.names.append("ZC011h") # self.names.append("ZC012") # 茶π # self.names.append("ZC012h") - # self.names.append("ZC013") # 椰奶 - # self.names.append("ZC014") # 农夫山泉 + self.names.append("ZC013") # 椰奶 + self.names.append("ZC014") # 农夫山泉 for name in self.names: self.result.append([name, 0, 0, 0, 0, 0]) model = dn('yolo6D/yolo-pose.cfg') @@ -413,17 +413,17 @@ def save_result(self): for res in self.result: if res[1] == 0: # 无有效识别 continue - f.write('GOAL_ID=%s;' % res[0]) - f.write('GOAL_X=%.1f;' % (res[2] / res[1])) - f.write('GOAL_Y=%.1f;' % (res[3] / res[1])) - f.write('GOAL_Angle=%.1f\n' % (res[5] / res[1])) + f.write('Goal_ID=%s;' % res[0]) + f.write('Goal_X=%.1f;' % (res[2] / res[1])) + f.write('Goal_Y=%.1f;' % (res[3] / res[1])) + f.write('Goal_Angle=%.1f\n' % (res[5] / res[1])) res[1] = res[2] = res[3] = res[4] = res[5] = 0 else: for res in self.result: if res[1] == 0: # 无有效识别 continue - f.write('GOAL_ID=%s;' % res[0]) - f.write('GOAL_Radius=%.1f\n' % (res[4] / res[1])) + f.write('Goal_ID=%s;' % res[0]) + f.write('Goal_Radius=%.1f\n' % (res[4] / res[1])) res[1] = res[2] = res[3] = res[4] = res[5] = 0 f.write('END') print(' \33[0;32m第%s回合结果已保存\033[0m' % self.round) diff --git a/circle_fit.py b/circle_fit.py index c181578..3e5e317 100644 --- a/circle_fit.py +++ b/circle_fit.py @@ -79,7 +79,8 @@ def circle_line(origin, thresed, S_thre=(100000, 600000)): # ret, thresh = cv2.threshold(imgray, 127, 255, cv2.THRESH_BINARY) # cv2.imshow("thres", thresh) # image, contours, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) - _, contours, _ = cv2.findContours(thresed, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) + # _, contours, _ = cv2.findContours(thresed, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) + contours, _ = cv2.findContours(thresed, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) top = []; bottle = []; right = []; left = []; center = [] Circle_2D = [] last_longest = 4 @@ -141,6 +142,7 @@ def circle_desk(num, x, canny, hough): thresed = corner.thres(img, x) thresed_new = corner.remove_small_objects(thresed) lined, _, Circle_2D = circle_line(img, thresed_new, [100000, 600000]) + # lined, _, Circle_2D = circle_line(img, thresed_new, [100000, 800000]) # affine_table_2D = np.float32([[0,0],[0,550],[550,0],[550,550]]) # M = cv2.getPerspectiveTransform(Table_2D,affine_table_2D) # marked = cv2.warpPerspective(lined,M,(550,550)) # Perspective_Transformation diff --git a/data1.txt b/data1.txt index 882f526..dc554a2 100644 --- a/data1.txt +++ b/data1.txt @@ -1,6 +1,6 @@ -red_low = 165 -red_high = 200 -green_low = 165 -green_high = 200 -blue_low = 165 -blue_high = 200 +red_low = 180 +red_high = 255 +green_low = 180 +green_high = 255 +blue_low = 180 +blue_high = 255 diff --git a/data2.txt b/data2.txt index a366f98..0fe32f9 100644 --- a/data2.txt +++ b/data2.txt @@ -3,4 +3,4 @@ canny_threshold_2 = 150 sobel = 3 hough_rho = 1 hough_theta = 1 -hough_threshold = 70 +hough_threshold = 60 diff --git a/debugger.py b/debugger.py index 86e2551..f8d5ef5 100644 --- a/debugger.py +++ b/debugger.py @@ -255,10 +255,10 @@ def setting_2(self): ho[2] = self.lineEdit_12.text() img = corner.thres(self.img, self.x) thresed = corner.remove_small_objects(img) - # edges = corner.square_canny(thresed, ca) + # edges = corner.square_canny(thresed, ca) # 方桌检测 # cv2.imshow('edges', edges) # lined, Table_2D = corner.square_line(self.img, edges, ho) - lined, _, Circle_2D = circle_fit.circle_line(self.img, thresed) + lined, _, Circle_2D = circle_fit.circle_line(self.img, thresed) # 圆桌检测 cv2.imshow('lines', lined) f = open("data2.txt", "w+") diff --git "a/\344\270\234\345\215\227\345\244\247\345\255\246-LabVIEW-R1.txt" "b/\344\270\234\345\215\227\345\244\247\345\255\246-LabVIEW-R1.txt" index b4a1932..e886785 100644 --- "a/\344\270\234\345\215\227\345\244\247\345\255\246-LabVIEW-R1.txt" +++ "b/\344\270\234\345\215\227\345\244\247\345\255\246-LabVIEW-R1.txt" @@ -1,3 +1,8 @@ START -GOAL_ID=ZC013;GOAL_X=17.2;GOAL_Y=33.7;GOAL_Angle=129.0 +GOAL_ID=ZA001;GOAL_X=27.0;GOAL_Y=47.4;GOAL_Angle=129.7 +GOAL_ID=ZA004;GOAL_X=48.1;GOAL_Y=38.9;GOAL_Angle=28.9 +GOAL_ID=ZB001;GOAL_X=8.3;GOAL_Y=48.3;GOAL_Angle=135.0 +GOAL_ID=ZC005;GOAL_X=47.3;GOAL_Y=41.6;GOAL_Angle=62.9 +GOAL_ID=ZC013;GOAL_X=7.2;GOAL_Y=47.0;GOAL_Angle=136.6 +GOAL_ID=ZC014;GOAL_X=27.5;GOAL_Y=43.2;GOAL_Angle=103.0 END \ No newline at end of file diff --git "a/\344\270\234\345\215\227\345\244\247\345\255\246-LabVIEW-R2.txt" "b/\344\270\234\345\215\227\345\244\247\345\255\246-LabVIEW-R2.txt" deleted file mode 100644 index 018436b..0000000 --- "a/\344\270\234\345\215\227\345\244\247\345\255\246-LabVIEW-R2.txt" +++ /dev/null @@ -1,5 +0,0 @@ -START -GOAL_ID=ZA001;GOAL_Radius30.8 -GOAL_ID=ZA004;GOAL_Radius27.4 -GOAL_ID=ZB008;GOAL_Radius48.4 -END \ No newline at end of file