Loading docs/source/config.rst +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ Default microscope_settings.yaml .. code-block:: yaml # Resolutions for streaming and capture video_resolution: [832, 624] stream_resolution: [832, 624] image_resolution: [2592, 1944] numpy_resolution: [1312, 976] Loading openflexure_microscope/api/v1/blueprints/base.py +1 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ class ConfigAPI(MicroscopeView): "plugins": [ "openflexure_microscope.plugins.default:Plugin" ], "video_resolution": [ "stream_resolution": [ 832, 624 ] Loading openflexure_microscope/camera/pi.py +8 −8 Original line number Diff line number Diff line Loading @@ -12,8 +12,8 @@ Video port: Splitter port 2: Video capture Splitter port 3: [Currently unused] StreamingCamera streams at video_resolution Camera capture resolution set to video_resolution in frames() StreamingCamera streams at stream_resolution Camera capture resolution set to stream_resolution in frames() Video port uses that resolution for everything. If a different resolution is specified for video capture, this is handled by the resizer. Loading Loading @@ -41,7 +41,7 @@ from .set_picamera_gain import set_analog_gain, set_digital_gain # Handle config and picamera settings CONFIG_KEYS = { 'video_resolution': (1640, 1232), 'stream_resolution': (832, 624), 'image_resolution': (2592, 1944), # Default for PiCamera v1. Overridden in __init__ 'numpy_resolution': (1312, 976), 'jpeg_quality': 75, Loading Loading @@ -304,7 +304,7 @@ class StreamingCamera(BaseCamera): output_stream, format=fmt, splitter_port=2, resize=self.config['video_resolution'], resize=self.config['stream_resolution'], quality=quality) # Update state dictionary Loading Loading @@ -365,7 +365,7 @@ class StreamingCamera(BaseCamera): Args: splitter_port (int): Splitter port to start recording on resolution ((int, int)): Resolution to set the camera to, before starting recording. Defaults to `self.config['video_resolution']`. resolution ((int, int)): Resolution to set the camera to, before starting recording. Defaults to `self.config['stream_resolution']`. """ # If stream object was destroyed if not hasattr(self, 'stream'): Loading @@ -373,7 +373,7 @@ class StreamingCamera(BaseCamera): # If no explicit resolution is passed if not resolution: resolution = self.config['video_resolution'] # Default to video recording resolution resolution = self.config['stream_resolution'] # Default to video recording resolution # Reduce the resolution for video streaming try: Loading Loading @@ -461,7 +461,7 @@ class StreamingCamera(BaseCamera): """ with self.lock: if use_video_port: resolution = self.config['video_resolution'] resolution = self.config['stream_resolution'] else: resolution = self.config['numpy_resolution'] Loading Loading @@ -501,7 +501,7 @@ class StreamingCamera(BaseCamera): """ with self.lock: if use_video_port: resolution = self.config['video_resolution'] resolution = self.config['stream_resolution'] else: resolution = self.config['numpy_resolution'] Loading tests/test_api.py +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ class TestCapture(unittest.TestCase): expected_keys = [ 'image_resolution', 'video_resolution', 'stream_resolution', 'numpy_resolution', ] Loading @@ -26,7 +26,7 @@ class TestCapture(unittest.TestCase): def test_capture_videoport(self): connection = APIconnection(host="localhost", port=5000, api_ver="v1") resolution = connection.get_config()['video_resolution'] resolution = connection.get_config()['stream_resolution'] for resize in [None, (640, 480)]: Loading tests/test_camera.py +3 −3 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ class TestCaptureMethods(unittest.TestCase): dims = resize else: if use_video_port: dims = camera.config['video_resolution'] dims = camera.config['stream_resolution'] else: dims = camera.config['image_resolution'] Loading Loading @@ -148,7 +148,7 @@ class TestUnencodedMethods(unittest.TestCase): dims = resize else: if use_video_port: dims = camera.config['video_resolution'] dims = camera.config['stream_resolution'] else: dims = camera.config['numpy_resolution'] Loading Loading @@ -180,7 +180,7 @@ class TestUnencodedMethods(unittest.TestCase): dims = resize else: if use_video_port: dims = camera.config['video_resolution'] dims = camera.config['stream_resolution'] else: dims = camera.config['numpy_resolution'] Loading Loading
docs/source/config.rst +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ Default microscope_settings.yaml .. code-block:: yaml # Resolutions for streaming and capture video_resolution: [832, 624] stream_resolution: [832, 624] image_resolution: [2592, 1944] numpy_resolution: [1312, 976] Loading
openflexure_microscope/api/v1/blueprints/base.py +1 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ class ConfigAPI(MicroscopeView): "plugins": [ "openflexure_microscope.plugins.default:Plugin" ], "video_resolution": [ "stream_resolution": [ 832, 624 ] Loading
openflexure_microscope/camera/pi.py +8 −8 Original line number Diff line number Diff line Loading @@ -12,8 +12,8 @@ Video port: Splitter port 2: Video capture Splitter port 3: [Currently unused] StreamingCamera streams at video_resolution Camera capture resolution set to video_resolution in frames() StreamingCamera streams at stream_resolution Camera capture resolution set to stream_resolution in frames() Video port uses that resolution for everything. If a different resolution is specified for video capture, this is handled by the resizer. Loading Loading @@ -41,7 +41,7 @@ from .set_picamera_gain import set_analog_gain, set_digital_gain # Handle config and picamera settings CONFIG_KEYS = { 'video_resolution': (1640, 1232), 'stream_resolution': (832, 624), 'image_resolution': (2592, 1944), # Default for PiCamera v1. Overridden in __init__ 'numpy_resolution': (1312, 976), 'jpeg_quality': 75, Loading Loading @@ -304,7 +304,7 @@ class StreamingCamera(BaseCamera): output_stream, format=fmt, splitter_port=2, resize=self.config['video_resolution'], resize=self.config['stream_resolution'], quality=quality) # Update state dictionary Loading Loading @@ -365,7 +365,7 @@ class StreamingCamera(BaseCamera): Args: splitter_port (int): Splitter port to start recording on resolution ((int, int)): Resolution to set the camera to, before starting recording. Defaults to `self.config['video_resolution']`. resolution ((int, int)): Resolution to set the camera to, before starting recording. Defaults to `self.config['stream_resolution']`. """ # If stream object was destroyed if not hasattr(self, 'stream'): Loading @@ -373,7 +373,7 @@ class StreamingCamera(BaseCamera): # If no explicit resolution is passed if not resolution: resolution = self.config['video_resolution'] # Default to video recording resolution resolution = self.config['stream_resolution'] # Default to video recording resolution # Reduce the resolution for video streaming try: Loading Loading @@ -461,7 +461,7 @@ class StreamingCamera(BaseCamera): """ with self.lock: if use_video_port: resolution = self.config['video_resolution'] resolution = self.config['stream_resolution'] else: resolution = self.config['numpy_resolution'] Loading Loading @@ -501,7 +501,7 @@ class StreamingCamera(BaseCamera): """ with self.lock: if use_video_port: resolution = self.config['video_resolution'] resolution = self.config['stream_resolution'] else: resolution = self.config['numpy_resolution'] Loading
tests/test_api.py +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ class TestCapture(unittest.TestCase): expected_keys = [ 'image_resolution', 'video_resolution', 'stream_resolution', 'numpy_resolution', ] Loading @@ -26,7 +26,7 @@ class TestCapture(unittest.TestCase): def test_capture_videoport(self): connection = APIconnection(host="localhost", port=5000, api_ver="v1") resolution = connection.get_config()['video_resolution'] resolution = connection.get_config()['stream_resolution'] for resize in [None, (640, 480)]: Loading
tests/test_camera.py +3 −3 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ class TestCaptureMethods(unittest.TestCase): dims = resize else: if use_video_port: dims = camera.config['video_resolution'] dims = camera.config['stream_resolution'] else: dims = camera.config['image_resolution'] Loading Loading @@ -148,7 +148,7 @@ class TestUnencodedMethods(unittest.TestCase): dims = resize else: if use_video_port: dims = camera.config['video_resolution'] dims = camera.config['stream_resolution'] else: dims = camera.config['numpy_resolution'] Loading Loading @@ -180,7 +180,7 @@ class TestUnencodedMethods(unittest.TestCase): dims = resize else: if use_video_port: dims = camera.config['video_resolution'] dims = camera.config['stream_resolution'] else: dims = camera.config['numpy_resolution'] Loading