mirror of
https://github.com/Project-Babble/ProjectBabble.git
synced 2026-12-04 15:52:21 -08:00
fixed frame grabber not activated correctly
This commit is contained in:
1 parent
17b08e35a5
commit
29d714c4c1
3 files changed
+11
-1
No files matched your search
@@ -0,0 +1 @@
|
||||
*.log
|
||||
@@ -449,6 +449,7 @@ class FTCamera:
|
||||
else:
|
||||
def read(self: 'FTCamera') -> None:
|
||||
"""Read frames until requested to exit."""
|
||||
self._filter_graph.run()
|
||||
while not self.terminator.terminate_requested:
|
||||
self._filter_graph.grab_frame()
|
||||
time.sleep(0.001)
|
||||
|
||||
@@ -80,7 +80,8 @@ class FTCameraController:
|
||||
def get_image(self: 'FTCameraController') -> np.ndarray:
|
||||
"""Get next image or None."""
|
||||
try:
|
||||
frame = self._proc_queue.get(True, 1)
|
||||
# timeout of 1s is a bit short. 2s is safer
|
||||
frame = self._proc_queue.get(True, 2)
|
||||
shape = unpack('HHH', frame[0:6])
|
||||
image = np.frombuffer(frame[6:], dtype=np.uint8).reshape(shape)
|
||||
return image
|
||||
@@ -116,6 +117,13 @@ class FTCameraController:
|
||||
|
||||
def _read_process(self: 'FTCameraController',
|
||||
queue: multiprocessing.connection.Connection) -> None:
|
||||
"""Read process function."""
|
||||
|
||||
"""
|
||||
logging.basicConfig(filename='ViveFaceTracker-ReadThread.log', filemode='w',
|
||||
encoding='utf-8', level=logging.INFO)
|
||||
"""
|
||||
|
||||
FTCameraController._logger.info("FTCameraController._read_process: ENTER")
|
||||
class Helper(FTCamera.Processor):
|
||||
"""Helper."""
|
||||
|
||||
Reference in new issue
Block a user