@@ -92,7 +92,6 @@ def explore_match(win, img1, img2, kp_pairs, status = None, H = None):
92
92
93
93
green = (0 , 255 , 0 )
94
94
red = (0 , 0 , 255 )
95
- white = (255 , 255 , 255 )
96
95
kp_color = (51 , 103 , 236 )
97
96
for (x1 , y1 ), (x2 , y2 ), inlier in zip (p1 , p2 , status ):
98
97
if inlier :
@@ -123,12 +122,12 @@ def onmouse(event, x, y, flags, param):
123
122
idxs = np .where (m )[0 ]
124
123
kp1s , kp2s = [], []
125
124
for i in idxs :
126
- (x1 , y1 ), (x2 , y2 ) = p1 [i ], p2 [i ]
127
- col = (red , green )[status [i ]]
128
- cv2 .line (cur_vis , (x1 , y1 ), (x2 , y2 ), col )
129
- kp1 , kp2 = kp_pairs [i ]
130
- kp1s .append (kp1 )
131
- kp2s .append (kp2 )
125
+ (x1 , y1 ), (x2 , y2 ) = p1 [i ], p2 [i ]
126
+ col = (red , green )[status [i ]]
127
+ cv2 .line (cur_vis , (x1 , y1 ), (x2 , y2 ), col )
128
+ kp1 , kp2 = kp_pairs [i ]
129
+ kp1s .append (kp1 )
130
+ kp2s .append (kp2 )
132
131
cur_vis = cv2 .drawKeypoints (cur_vis , kp1s , None , flags = 4 , color = kp_color )
133
132
cur_vis [:,w1 :] = cv2 .drawKeypoints (cur_vis [:,w1 :], kp2s , None , flags = 4 , color = kp_color )
134
133
@@ -183,7 +182,7 @@ def match_and_draw(win):
183
182
H , status = None , None
184
183
print ('%d matches found, not enough for homography estimation' % len (p1 ))
185
184
186
- vis = explore_match (win , img1 , img2 , kp_pairs , status , H )
185
+ _vis = explore_match (win , img1 , img2 , kp_pairs , status , H )
187
186
188
187
match_and_draw ('find_obj' )
189
188
cv2 .waitKey ()
0 commit comments