ethoscope.hardware.input package¶
Submodules¶
ethoscope.hardware.input.cameras module¶
-
class
ethoscope.hardware.input.cameras.
BaseCamera
(drop_each=1, max_duration=None, *args, **kwargs)[source]¶ Bases:
object
The template class to generate and use video streams.
Parameters: - drop_each – keep only
1/drop_each
‘th frame - max_duration – stop the video stream if
t > max_duration
(in seconds). - args – additional arguments
- kwargs – additional keyword arguments
-
capture
= None¶
- drop_each – keep only
-
class
ethoscope.hardware.input.cameras.
DummyFrameGrabber
(target_fps, target_resolution, queue, stop_queue, path, *args, **kwargs)[source]¶ Bases:
multiprocessing.process.Process
Class to mimic the behaviour of
PiFrameGrabber
. This is intended for testing purposes. This way, we can emulate the async functionality of the hardware camera by a video file.Parameters: - target_fps (int) – the desired number of frames par second (FPS)
- target_fps – the desired resolution (W x H)
- target_resolution – (int,int)
- args – additional arguments
- kwargs – additional keyword arguments
-
class
ethoscope.hardware.input.cameras.
DummyPiCameraAsync
(target_fps=20, target_resolution=(1280, 960), *args, **kwargs)[source]¶ Bases:
ethoscope.hardware.input.cameras.OurPiCameraAsync
Class to mimic the behaviour of
OurPiCameraAsync
. This is intended for testing purposes. This way, we can emulate the async functionality of the hardware camera by a video file.Class to acquire frames from the raspberry pi camera asynchronously. At the moment, frames are only greyscale images.
Parameters: - target_fps (int) – the desired number of frames par second (FPS)
- target_fps – the desired resolution (W x H)
- target_resolution – (int,int)
- args – additional arguments
- kwargs – additional keyword arguments
-
class
ethoscope.hardware.input.cameras.
MovieVirtualCamera
(path, use_wall_clock=False, *args, **kwargs)[source]¶ Bases:
ethoscope.hardware.input.cameras.BaseCamera
Class to acquire frames from a video file.
Parameters: -
path
¶
-
start_time
¶
-
-
class
ethoscope.hardware.input.cameras.
OurPiCameraAsync
(target_fps=20, target_resolution=(1280, 960), *args, **kwargs)[source]¶ Bases:
ethoscope.hardware.input.cameras.BaseCamera
Class to acquire frames from the raspberry pi camera asynchronously. At the moment, frames are only greyscale images.
Parameters: - target_fps (int) – the desired number of frames par second (FPS)
- target_fps – the desired resolution (W x H)
- target_resolution – (int,int)
- args – additional arguments
- kwargs – additional keyword arguments
-
start_time
¶
-
class
ethoscope.hardware.input.cameras.
PiFrameGrabber
(target_fps, target_resolution, queue, stop_queue, *args, **kwargs)[source]¶ Bases:
multiprocessing.process.Process
Class to grab frames from pi camera. Designed to be used within
OurPiCameraAsync
This allows to get frames asynchronously as acquisition is a bottleneck.Parameters: - target_fps (int) – desired fps
- target_resolution ((int, int)) – the desired resolution (w, h)
- queue (
JoinableQueue
) – a queue that stores frame and makes them available to the parent process - stop_queue (
JoinableQueue
) – a queue that can stop the async acquisition - args – additional arguments
- kwargs – additional keyword arguments
-
class
ethoscope.hardware.input.cameras.
V4L2Camera
(device=0, target_fps=5, target_resolution=(960, 720), *args, **kwargs)[source]¶ Bases:
ethoscope.hardware.input.cameras.BaseCamera
class to acquire stream from a video for linux compatible device (v4l2).
Parameters: -
start_time
¶
-