saim1309 commited on
Commit
e0400ee
·
verified ·
1 Parent(s): c897685

Update plot.py

Browse files
Files changed (1) hide show
  1. plot.py +3 -3
plot.py CHANGED
@@ -62,7 +62,7 @@ def extract_points_from_xml(xml_file):
62
  return np.array([points[p] for p in order], dtype=np.float32)
63
 
64
  # ========= Draw correspondences and (optional) boxes =========
65
- def draw_feature_matching(img1, pts1, img2, pts2, draw_boxes=True):
66
  """
67
  Draws feature correspondences between two images, handling different sizes.
68
  """
@@ -90,8 +90,8 @@ def draw_feature_matching(img1, pts1, img2, pts2, draw_boxes=True):
90
 
91
  # Optional: Draw polygons (boxes)
92
  if draw_boxes:
93
- cv2.polylines(new_img, [pts1_scaled.reshape((-1,1,2))], True, (0,255,0), 3)
94
- cv2.polylines(new_img, [pts2_scaled.reshape((-1,1,2)) + np.array([w1,0])], True, (0,255,0), 3)
95
 
96
  # Draw correspondences
97
  for (x1, y1), (x2, y2) in zip(pts1_scaled, pts2_scaled):
 
62
  return np.array([points[p] for p in order], dtype=np.float32)
63
 
64
  # ========= Draw correspondences and (optional) boxes =========
65
+ def draw_feature_matching(img1, pts1, img2, pts2, color,draw_boxes=True):
66
  """
67
  Draws feature correspondences between two images, handling different sizes.
68
  """
 
90
 
91
  # Optional: Draw polygons (boxes)
92
  if draw_boxes:
93
+ cv2.polylines(new_img, [pts1_scaled.reshape((-1,1,2))], True, color, 3)
94
+ cv2.polylines(new_img, [pts2_scaled.reshape((-1,1,2)) + np.array([w1_new,0])], True, color, 3)
95
 
96
  # Draw correspondences
97
  for (x1, y1), (x2, y2) in zip(pts1_scaled, pts2_scaled):