Skip to content

Commit e0f98cd

Browse files
committed
camera: Fix keyword arg.
Signed-off-by: iabdalkader <[email protected]>
1 parent e55eff5 commit e0f98cd

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OpenMV Python
22

3-
Python library and CLI for communicating with OpenMV cameras using Protocol V2.
3+
Python library and CLI for communicating with OpenMV cameras.
44

55
## Installation
66

@@ -20,7 +20,7 @@ openmv --port /dev/ttyACM0
2020
openmv --port /dev/ttyACM0 --script my_script.py
2121

2222
# Adjust display scale (default is 4x)
23-
openmv --port /dev/ttyACM0 --scale 2
23+
openmv --port /dev/ttyACM0 --scale 5
2424

2525
# Run throughput benchmark
2626
openmv --port /dev/ttyACM0 --bench
@@ -152,9 +152,7 @@ with Camera('/dev/ttyACM0') as camera:
152152
print(f"Ticks: {data.decode()}")
153153
```
154154

155-
## API Reference
156-
157-
Full API documentation: [docs/api.md](https://github.com/openmv/openmv-python/blob/master/docs/api.md)
155+
## Quick Reference
158156

159157
### Camera
160158

@@ -183,7 +181,7 @@ Camera(
183181
| `is_connected()` | Check connection status |
184182
| `exec(script)` | Execute a MicroPython script |
185183
| `stop()` | Stop the running script |
186-
| `streaming(enable, raw=False, res=None)` | Enable/disable video streaming |
184+
| `streaming(enable, raw=False, resolution=None)` | Enable/disable video streaming |
187185
| `read_frame()` | Read video frame → `{width, height, format, depth, data, raw_size}` |
188186
| `read_stdout()` | Read script output text |
189187
| `read_status()` | Poll channel status → `{channel_name: bool, ...}` |
@@ -212,6 +210,10 @@ Camera(
212210
| `ChecksumException` | CRC validation failure |
213211
| `SequenceException` | Sequence number mismatch |
214212

213+
## API documentation
214+
215+
Full API documentation: [docs/api.md](https://github.com/openmv/openmv-python/blob/master/docs/api.md)
216+
215217
## Requirements
216218

217219
- Python 3.8+

docs/api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ camera.stop()
132132

133133
## Video Streaming
134134

135-
### streaming(enable, raw=False, res=None)
135+
### streaming(enable, raw=False, resolution=None)
136136

137137
Enable or disable video streaming.
138138

139139
```python
140-
camera.streaming(True, raw=False, res=(512, 512))
140+
camera.streaming(True, raw=False, resolution=(512, 512))
141141
```
142142

143143
#### Parameters
@@ -146,7 +146,7 @@ camera.streaming(True, raw=False, res=(512, 512))
146146
|-----------|------|---------|-------------|
147147
| `enable` | bool | required | Enable or disable streaming |
148148
| `raw` | bool | False | Enable raw streaming mode |
149-
| `res` | tuple | None | Resolution tuple (width, height) for raw mode |
149+
| `resolution` | tuple | None | Resolution tuple (width, height) for raw mode |
150150

151151
---
152152

src/openmv/camera.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,11 @@ def exec(self, script):
345345
self._channel_ioctl(stdin_id, ChannelIOCTL.STDIN_EXEC)
346346

347347
@retry_if_failed
348-
def streaming(self, enable, raw=False, res=None):
348+
def streaming(self, enable, raw=False, resolution=None):
349349
"""Enable or disable streaming"""
350350
stream_id = self.get_channel(name="stream")
351351
if raw:
352-
self._channel_ioctl(stream_id, ChannelIOCTL.STREAM_RAW_CFG, 'II', *res)
352+
self._channel_ioctl(stream_id, ChannelIOCTL.STREAM_RAW_CFG, 'II', *resolution)
353353
self._channel_ioctl(stream_id, ChannelIOCTL.STREAM_RAW_CTRL, 'I', raw)
354354
self._channel_ioctl(stream_id, ChannelIOCTL.STREAM_CTRL, 'I', enable)
355355

0 commit comments

Comments
 (0)