fix samples 3.4

This commit is contained in:
APrigarina
2021-06-30 12:50:21 +03:00
parent 828304d587
commit 5e80bd3cc9
6 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -77,8 +77,8 @@ class App:
for (x0, y0), (x1, y1), good in zip(self.p0[:,0], self.p1[:,0], status[:,0]):
if good:
cv.line(vis, (x0, y0), (x1, y1), (0, 128, 0))
cv.circle(vis, (x1, y1), 2, (red, green)[good], -1)
cv.line(vis, (int(x0), int(y0)), (int(x1), int(y1)), (0, 128, 0))
cv.circle(vis, (int(x1), int(y1)), 2, (red, green)[good], -1)
draw_str(vis, (20, 20), 'track count: %d' % len(self.p1))
if self.use_ransac:
draw_str(vis, (20, 40), 'RANSAC')
@@ -86,7 +86,7 @@ class App:
p = cv.goodFeaturesToTrack(frame_gray, **feature_params)
if p is not None:
for x, y in p[:,0]:
cv.circle(vis, (x, y), 2, green, -1)
cv.circle(vis, (int(x), int(y)), 2, green, -1)
draw_str(vis, (20, 20), 'feature count: %d' % len(p))
cv.imshow('lk_homography', vis)