1#on efficient solution
2
3frame_rate = 10
4prev = 0
5
6while capturing:
7
8 time_elapsed = time.time() - prev
9 res, image = cap.read()
10
11 if time_elapsed > 1./frame_rate:
12 prev = time.time()
13
14 # Do something with your image here.
15 process_image()