File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 77import cv2
88import threading
99import queue
10+ import time
1011
1112logger = logging .getLogger ('detect.capture' )
1213
@@ -26,6 +27,10 @@ def run(self):
2627 logger .info ("Camera thread has started..." )
2728
2829 while not self .stop_event .is_set ():
30+
31+ # Control FPS manually, because sometimes the FPS assignment performed by CV2 does not work
32+ time .sleep (1.0 / self .config ['fps' ])
33+
2934 read_ok , image = self .camera .read ()
3035
3136 if not read_ok :
@@ -54,7 +59,8 @@ def cam_setup(self):
5459 # Initial camera configuration
5560 self .camera .set (3 , self .config ['resolution' ][0 ])
5661 self .camera .set (4 , self .config ['resolution' ][1 ])
57- self .camera .set (5 , self .config ['fps' ])
62+ # The microcontroller controlls cameras does not support FPS assignment
63+ #self.camera.set(5, self.config['fps'])
5864
5965 def quit (self ):
6066 self .camera .release ()
You can’t perform that action at this time.
0 commit comments