dibahadie commited on
Commit
8cc7b68
1 Parent(s): b085f68

Update segment_key.py

Browse files
Files changed (1) hide show
  1. segment_key.py +11 -9
segment_key.py CHANGED
@@ -325,23 +325,25 @@ def rotate_image(image):
325
 
326
 
327
  def show_kps(contour):
328
- features = []
329
  list1 = range(0, 300)
330
  list2 = list(zip(get_features_right(contour), list1))
331
- features += list2
 
332
 
333
  list2 = list(zip(get_features_left(contour), list1))
334
- features += list2
 
335
 
336
  list2 = list(zip(list1, get_features_up(contour)))
337
- features += list2
 
338
 
339
- list2 = list(zip(list1, get_features_down(contour)))
340
- features += list2
341
 
342
- black_image = np.zeros((300, 300), dtype=np.uint8)
343
- features = np.array(features)
344
- cv2.drawContours(black_image, [features], -1, (255, 255, 255), 2)
 
345
  return black_image
346
 
347
 
 
325
 
326
 
327
  def show_kps(contour):
328
+ black_image = np.zeros((300, 300), dtype=np.uint8)
329
  list1 = range(0, 300)
330
  list2 = list(zip(get_features_right(contour), list1))
331
+ list2 = np.array(list2)
332
+ cv2.drawContours(black_image, [list2], -1, (255, 255, 255), 2)
333
 
334
  list2 = list(zip(get_features_left(contour), list1))
335
+ list2 = np.array(list2)
336
+ cv2.drawContours(black_image, [list2], -1, (255, 255, 255), 2)
337
 
338
  list2 = list(zip(list1, get_features_up(contour)))
339
+ list2 = np.array(list2)
340
+ cv2.drawContours(black_image, [list2], -1, (255, 255, 255), 2)
341
 
 
 
342
 
343
+ list2 = list(zip(list1, get_features_down(contour)))
344
+ list2 = np.array(list2)
345
+ cv2.drawContours(black_image, [list2], -1, (255, 255, 255), 2)
346
+
347
  return black_image
348
 
349