Skip to content

Commit cd7d426

Browse files
committed
Fix bug: TypeError- integer argument expected, got float
1 parent 51fa622 commit cd7d426

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/optflow/samples/motempl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def nothing(dummy):
1414
def draw_motion_comp(vis, rect, angle, color):
1515
x, y, w, h = rect
1616
cv.rectangle(vis, (x, y), (x+w, y+h), (0, 255, 0))
17-
r = min(w/2, h/2)
18-
cx, cy = x+w/2, y+h/2
17+
r = min(w//2, h//2)
18+
cx, cy = x+w//2, y+h//2
1919
angle = angle*np.pi/180
2020
cv.circle(vis, (cx, cy), r, color, 3)
2121
cv.line(vis, (cx, cy), (int(cx+np.cos(angle)*r), int(cy+np.sin(angle)*r)), color, 3)

0 commit comments

Comments
 (0)