Task #14676

Support #14557: création d'une vidéo au ralenti par opencv

Code qui execute des taches periodeique chaque minute

Added by Marouane SOBTI 3 months ago.

Status:NewStart date:11/22/2022
Priority:NormalDue date:
Assignee:Marouane SOBTI% Done:

80%

Category:-
Target version:Polytech Projets GE - Deuxième Itération 2022
Remaining (hours)

Description

import cv2
import sched, time

s = sched.scheduler(time.time, time.sleep)

def capture_each_minute(sc):
print("Capturing")
vidcap = cv2.VideoCapture(0)

if vidcap.isOpened():
ret, frame = vidcap.read() #capture a frame from live video
if ret:
while(True):
cv2.imshow("Frame",frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
else:
print("Error : Failed to capture frame")
else:
print("Cannot open camera")
sc.enter(60, 1, capture_each_minute, (sc,))

s.enter(60, 1, capture_each_minute, (s,))
s.run()


Related issues

Copied to Task #14732: Code qui execute des taches periodeique chaque minute New 11/22/2022

History

#1 Updated by Sebastien LENGAGNE 3 months ago

  • Copied to Task #14732: Code qui execute des taches periodeique chaque minute added

Also available in: Atom PDF