Commit 34b82ff0 authored by Maksim Shabunin's avatar Maksim Shabunin

Merge pull request #1027 from berak:fix_motempl_py

parents 29286b3b 3f7e74db
......@@ -37,7 +37,8 @@ if __name__ == '__main__':
sys.exit(1)
ret, frame = cam.read()
if ret == False:
break
print("could not read from " + str(video_src) + " !\n")
sys.exit(1)
h, w = frame.shape[:2]
prev_frame = frame.copy()
motion_history = np.zeros((h, w), np.float32)
......@@ -45,6 +46,8 @@ if __name__ == '__main__':
hsv[:,:,1] = 255
while True:
ret, frame = cam.read()
if ret == False:
break
frame_diff = cv2.absdiff(frame, prev_frame)
gray_diff = cv2.cvtColor(frame_diff, cv2.COLOR_BGR2GRAY)
thrs = cv2.getTrackbarPos('threshold', 'motempl')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment