Skip to content

Commit

Permalink
830 plan-A
Browse files Browse the repository at this point in the history
  • Loading branch information
molguitianzn committed Aug 30, 2019
1 parent c05175f commit 3c71047
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 30 deletions.
Binary file modified JPEGImages/13.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 14 additions & 14 deletions QT.py
Original file line number Diff line number Diff line change
Expand Up @@ -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") # 太平饼干
Expand All @@ -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") # 冰红茶
Expand All @@ -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')
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion circle_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions data1.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion data2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ canny_threshold_2 = 150
sobel = 3
hough_rho = 1
hough_theta = 1
hough_threshold = 70
hough_threshold = 60
4 changes: 2 additions & 2 deletions debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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+")
Expand Down
7 changes: 6 additions & 1 deletion 东南大学-LabVIEW-R1.txt
Original file line number Diff line number Diff line change
@@ -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
5 changes: 0 additions & 5 deletions 东南大学-LabVIEW-R2.txt

This file was deleted.

0 comments on commit 3c71047

Please sign in to comment.