Samples Python:

* Unused variables
* Bad identation
This commit is contained in:
tribta
2017-08-24 17:45:14 +01:00
parent 9bb17caa24
commit 7555ab194f
20 changed files with 43 additions and 45 deletions
+7 -8
View File
@@ -92,7 +92,6 @@ def explore_match(win, img1, img2, kp_pairs, status = None, H = None):
green = (0, 255, 0)
red = (0, 0, 255)
white = (255, 255, 255)
kp_color = (51, 103, 236)
for (x1, y1), (x2, y2), inlier in zip(p1, p2, status):
if inlier:
@@ -123,12 +122,12 @@ def explore_match(win, img1, img2, kp_pairs, status = None, H = None):
idxs = np.where(m)[0]
kp1s, kp2s = [], []
for i in idxs:
(x1, y1), (x2, y2) = p1[i], p2[i]
col = (red, green)[status[i]]
cv2.line(cur_vis, (x1, y1), (x2, y2), col)
kp1, kp2 = kp_pairs[i]
kp1s.append(kp1)
kp2s.append(kp2)
(x1, y1), (x2, y2) = p1[i], p2[i]
col = (red, green)[status[i]]
cv2.line(cur_vis, (x1, y1), (x2, y2), col)
kp1, kp2 = kp_pairs[i]
kp1s.append(kp1)
kp2s.append(kp2)
cur_vis = cv2.drawKeypoints(cur_vis, kp1s, None, flags=4, color=kp_color)
cur_vis[:,w1:] = cv2.drawKeypoints(cur_vis[:,w1:], kp2s, None, flags=4, color=kp_color)
@@ -183,7 +182,7 @@ if __name__ == '__main__':
H, status = None, None
print('%d matches found, not enough for homography estimation' % len(p1))
vis = explore_match(win, img1, img2, kp_pairs, status, H)
_vis = explore_match(win, img1, img2, kp_pairs, status, H)
match_and_draw('find_obj')
cv2.waitKey()