opticmix-vision 0.0.3.post1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. opticmix_vision-0.0.3.post1/LICENSE +202 -0
  2. opticmix_vision-0.0.3.post1/PKG-INFO +284 -0
  3. opticmix_vision-0.0.3.post1/README.md +258 -0
  4. opticmix_vision-0.0.3.post1/THIRD_PARTY_NOTICES.txt +996 -0
  5. opticmix_vision-0.0.3.post1/opticmix_vision/__init__.py +51 -0
  6. opticmix_vision-0.0.3.post1/opticmix_vision/_ctrl_dshow.py +112 -0
  7. opticmix_vision-0.0.3.post1/opticmix_vision/_ctrl_opencv.py +84 -0
  8. opticmix_vision-0.0.3.post1/opticmix_vision/_ctrl_sim.py +82 -0
  9. opticmix_vision-0.0.3.post1/opticmix_vision/_cvprops.py +74 -0
  10. opticmix_vision-0.0.3.post1/opticmix_vision/_native.py +31 -0
  11. opticmix_vision-0.0.3.post1/opticmix_vision/controls.py +317 -0
  12. opticmix_vision-0.0.3.post1/opticmix_vision/device.py +524 -0
  13. opticmix_vision-0.0.3.post1/opticmix_vision/devices.py +106 -0
  14. opticmix_vision-0.0.3.post1/opticmix_vision/explorer/__init__.py +13 -0
  15. opticmix_vision-0.0.3.post1/opticmix_vision/explorer/__main__.py +6 -0
  16. opticmix_vision-0.0.3.post1/opticmix_vision/explorer/app.py +376 -0
  17. opticmix_vision-0.0.3.post1/opticmix_vision/explorer/capture.py +89 -0
  18. opticmix_vision-0.0.3.post1/opticmix_vision/explorer/settings_window.py +300 -0
  19. opticmix_vision-0.0.3.post1/opticmix_vision/explorer/state.py +139 -0
  20. opticmix_vision-0.0.3.post1/opticmix_vision/explorer/theme.py +20 -0
  21. opticmix_vision-0.0.3.post1/opticmix_vision/led.py +106 -0
  22. opticmix_vision-0.0.3.post1/opticmix_vision/synthetic.py +114 -0
  23. opticmix_vision-0.0.3.post1/opticmix_vision/viewer.py +340 -0
  24. opticmix_vision-0.0.3.post1/pyproject.toml +54 -0
  25. opticmix_vision-0.0.3.post1/rust/Cargo.lock +322 -0
  26. opticmix_vision-0.0.3.post1/rust/Cargo.toml +4 -0
  27. opticmix_vision-0.0.3.post1/rust/opticmix-vision/Cargo.toml +21 -0
  28. opticmix_vision-0.0.3.post1/rust/opticmix-vision/src/backend.rs +355 -0
  29. opticmix_vision-0.0.3.post1/rust/opticmix-vision/src/controls.rs +2125 -0
  30. opticmix_vision-0.0.3.post1/rust/opticmix-vision/src/convert.rs +297 -0
  31. opticmix_vision-0.0.3.post1/rust/opticmix-vision/src/devices.rs +351 -0
  32. opticmix_vision-0.0.3.post1/rust/opticmix-vision/src/dshow.rs +659 -0
  33. opticmix_vision-0.0.3.post1/rust/opticmix-vision/src/error.rs +158 -0
  34. opticmix_vision-0.0.3.post1/rust/opticmix-vision/src/guard.rs +335 -0
  35. opticmix_vision-0.0.3.post1/rust/opticmix-vision/src/lib.rs +15 -0
  36. opticmix_vision-0.0.3.post1/rust/opticmix-vision/src/spec.rs +383 -0
  37. opticmix_vision-0.0.3.post1/rust/opticmix-vision-py/Cargo.toml +25 -0
  38. opticmix_vision-0.0.3.post1/rust/opticmix-vision-py/src/bindings.rs +862 -0
  39. opticmix_vision-0.0.3.post1/rust/opticmix-vision-py/src/lib.rs +10 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Opticmix Inc.
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,284 @@
1
+ Metadata-Version: 2.4
2
+ Name: opticmix-vision
3
+ Version: 0.0.3.post1
4
+ Classifier: Development Status :: 2 - Pre-Alpha
5
+ Classifier: License :: OSI Approved :: Apache Software License
6
+ Classifier: Operating System :: Microsoft :: Windows
7
+ Classifier: Operating System :: POSIX :: Linux
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Rust
10
+ Classifier: Topic :: Multimedia :: Video :: Capture
11
+ Requires-Dist: numpy>=1.24
12
+ Requires-Dist: opencv-python>=4.8
13
+ Requires-Dist: pytest>=7 ; extra == 'dev'
14
+ Provides-Extra: dev
15
+ License-File: LICENSE
16
+ License-File: THIRD_PARTY_NOTICES.txt
17
+ Summary: Python SDK for the Weevia S1 stereo IR camera (UVC): capture, stereo split, camera controls, IR illuminator
18
+ Keywords: stereo,infrared,camera,uvc,fisheye
19
+ Author: Opticmix
20
+ License: Apache-2.0
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
23
+ Project-URL: Homepage, https://github.com/Opticmix/opticmix-vision
24
+ Project-URL: Issues, https://github.com/Opticmix/opticmix-vision/issues
25
+
26
+ # opticmix-vision
27
+
28
+ Python SDK for the **Weevia S1** stereo infrared camera — a close-range stereo IR
29
+ camera with its own 850 nm (vendor spec) flood illuminator, presented to the host as a standard
30
+ UVC device.
31
+
32
+ No vendor driver, no GPU runtime. Two Python dependencies: `numpy` and `opencv-python`.
33
+ Camera controls and device listing run in a compiled extension that ships inside
34
+ the wheel, so there is nothing to build.
35
+
36
+ Install it from PyPI:
37
+
38
+ ```bash
39
+ pip install opticmix-vision
40
+ ```
41
+
42
+ On Windows x64 this installs a wheel — one abi3 wheel for Python 3.10 and newer;
43
+ installed and tested on 3.10, 3.12 and 3.14 (no camera). The same file is
44
+ attached to the GitHub release [v0.0.3.post1](https://github.com/Opticmix/opticmix-vision/releases/tag/v0.0.3.post1).
45
+ On Windows, verified on Windows 11 only. There is no wheel for macOS, and macOS
46
+ has not been run. Elsewhere pip tries to build from source: Rust 1.88 or newer
47
+ (on Windows also the Microsoft C++ Build Tools). A source install has been
48
+ checked on Linux x86_64 only (Debian 12 container, Python 3.11, Rust 1.88.0,
49
+ no camera).
50
+
51
+ ### Linux (experimental)
52
+
53
+ **Experimental — not a supported platform.** The 0.0.3 release on GitHub also
54
+ carries a Linux x86_64 wheel, `opticmix_vision-0.0.3-cp310-abi3-linux_x86_64.whl`.
55
+ It is not on PyPI; there, Linux installs from source (Rust toolchain needed).
56
+
57
+ What has been run: on 2026-11-22, on an Ubuntu 26.04 (kernel 7.0) mini PC with
58
+ one Weevia S1 (firmware version not recorded) connected directly over USB
59
+ SuperSpeed, a candidate build of 0.0.3 from the same source negotiated
60
+ 1600×800 MJPG at 90 fps. Over 20 seconds both
61
+ eyes changed on every frame: about 85.6 unique frames per second by our
62
+ measurement script, 88.95 per second by the kernel's buffer count, with no
63
+ kernel USB errors. The measurement opened the camera with
64
+ `DeviceConfig(layout="sbs", lr_order="first_is_right", backend="v4l2", device=0,
65
+ width=1600, height=800, fps=90, fourcc="MJPG", stall_frames=0)`
66
+ (`device` is the N of `/dev/videoN`; `stall_frames=0` because the script counted
67
+ repeated images itself).
68
+
69
+ On Linux, name the camera yourself:
70
+ `DeviceConfig.weevia_s1(device="/dev/video0", backend="v4l2")`, with the
71
+ Weevia's own `/dev/videoN` (on a laptop `/dev/video0` may be the built-in
72
+ webcam). In 0.0.3,
73
+ finding the camera by name uses DirectShow and works only on Windows.
74
+
75
+ Not verified on Linux:
76
+
77
+ - camera controls and the illuminator — not verified and not supported;
78
+ - finding the camera by name (`DeviceConfig.weevia_s1()` without `device=`) —
79
+ Windows-only in 0.0.3;
80
+ - the viewer, the explorer and the examples;
81
+ - other distributions and more than one camera.
82
+
83
+ ## Quickstart
84
+
85
+ ```python
86
+ from opticmix_vision import Device, DeviceConfig
87
+
88
+ with Device(DeviceConfig.weevia_s1()) as cam:
89
+ print(cam.mode.to_dict()) # what the driver actually negotiated
90
+ frame = cam.read() # raises on failure, never returns an empty frame
91
+ left, right = frame.left, frame.right # each (800, 800) uint8
92
+ ```
93
+
94
+ `DeviceConfig.weevia_s1()` finds the camera **by name** and applies the settings
95
+ measured on it: both eyes side by side, the first half is the **right** eye
96
+ (measured on one unit, 2026-09-16), 1600×800 MJPG at 90 fps. It does not pick a camera by index — plugging in any
97
+ other camera shifts the order, and a laptop webcam is often listed first.
98
+ Override any field, e.g. `DeviceConfig.weevia_s1(fps=60)`. Finding the camera by name: measured with the earlier Python implementation; the Rust implementation in 0.0.3 has not yet been verified against the camera.
99
+
100
+ `examples/quickstart.py` runs this end to end; `python -m opticmix_vision.viewer`
101
+ and `python -m opticmix_vision.explorer` open the same camera in a window.
102
+
103
+ For another camera, build `DeviceConfig(layout=..., lr_order=..., device=...)`
104
+ yourself (`device` is then an index; plugging in another camera changes it). `layout` and `lr_order` then have no defaults — the SDK will not guess
105
+ how two eyes are packed into one frame, because guessing wrong silently mirrors
106
+ everything downstream. To check the order, stand behind the camera, looking where
107
+ it looks, cover the lens on your left with a finger, and see which image goes dark.
108
+
109
+ ### Capture modes
110
+
111
+ The camera reports these itself:
112
+
113
+ | Format | Resolutions | fps |
114
+ |---|---|---|
115
+ | MJPG | 2560×800, 1600×800, 1280×400, 800×400 | 30 – 90 |
116
+ | YUY2 | same four | 10 – 45 |
117
+
118
+ At 1600×800 each eye is 800×800. The driver may not give you the mode you asked
119
+ for — read `cam.mode` rather than assuming. Request the fourcc: without
120
+ `fourcc="MJPG"` taking effect, the stream has run at 9.3 fps (measured 2026-09-13, one unit).
121
+
122
+ ### Stereo packing
123
+
124
+ | `layout` | frame shape | split |
125
+ |---|---|---|
126
+ | `sbs` | (H, 2W) | left half / right half |
127
+ | `tb` | (2H, W) | top half / bottom half |
128
+ | `plane_pack` | (H, W, 2) raw, needs `CAP_PROP_CONVERT_RGB=0` | channel 0 / channel 1 |
129
+
130
+ `lr_order` is `first_is_left` or `first_is_right`.
131
+
132
+ ## Camera controls
133
+
134
+ `cam.controls` covers every control the camera advertises — the same set the Windows driver's property
135
+ page (and the vendor's AMCap tool) shows. Ranges and defaults come from the device, not from this package.
136
+ Measured with the earlier Python implementation; the Rust implementation in 0.0.3 has not yet been verified against the camera.
137
+
138
+ ```python
139
+ cfg = DeviceConfig.weevia_s1()
140
+ with Device(cfg) as cam:
141
+ c = cam.controls
142
+ c.describe("gain") # current, min/max/step, device default, units, verification status
143
+ c.set("gain", 28) # does not wait — returns WriteResult(status="pending")
144
+ c.set_many({"auto_exposure": "manual", "exposure": -5}) # mode and value in one write
145
+ c.flush() # wait for queued writes
146
+ ```
147
+
148
+ | control | kind | on this camera |
149
+ |---|---|---|
150
+ | brightness, contrast, gamma | int | 0–100; image effect not verified |
151
+ | sharpness | int | 0–100; image effect not measured |
152
+ | gain | int | 0–255. 28 is kept; 16 was kept on one day and read back as 0 on another, and 8 read back as 0 once — cause not known yet |
153
+ | backlight_compensation | int | the IR illuminator — see below |
154
+ | exposure | int | −13–0 in the driver's units (`log2_s_nominal`); not converted to time, because −3 ran at 35–38 fps where 125 ms would give 8 |
155
+ | auto_exposure | `manual`/`auto` | readable here (OpenCV reports −1). Switching back to `auto` once froze one eye for about 1 s; it recovered by itself |
156
+ | auto_exposure_priority | bool | only matters in auto. The camera reports 5 (range 5–5) instead of 0/1; writing it is untested |
157
+ | power_line_frequency | `disabled`/`50hz`/`60hz` | the device default is `disabled`; the 60 Hz seen at start appears to come from the Windows driver |
158
+ | hue, saturation, white_balance, auto_white_balance | — | advertised, but no effect is expected on this mono sensor |
159
+
160
+ Focus, zoom, pan, tilt and iris are not advertised — the lens is mechanically fixed. The driver still answers
161
+ for iris, which is why AMCap shows that row; the SDK does not expose it.
162
+
163
+ The table was measured with the earlier Python implementation; the Rust implementation in 0.0.3 has not
164
+ yet been verified against the camera.
165
+
166
+ **Writing is risky on this camera.** On the units we have tested, a control write has occasionally been
167
+ followed by one eye's stream stopping until the USB cable was re-inserted. Every write goes through one guard: equal values are skipped, requests inside
168
+ the interval collapse to the latest value, and writes are spaced at least 12 ms apart (the camera
169
+ vendor's recommended minimum between exposure commands; used for every control). The explorer's sliders
170
+ write once when released and the viewer's keys once you stop pressing, so a drag is one write, not dozens.
171
+ The guard does not make writes safe. **Write once at startup.** Right after an exposure change the two eyes can
172
+ disagree in brightness for about 90 ms (measured on one unit) — drop those frames before stereo matching or
173
+ training. Writing exposure while
174
+ `auto_exposure` is `auto` raises `ControlStateError`; give both in one `set_many`. Measured with the earlier Python implementation; the Rust implementation in 0.0.3 has not yet been verified against the camera.
175
+
176
+ A `written` result only means the driver accepted the value. Every write is read back:
177
+ `result.readback` is what the camera reports afterwards and `result.kept` says whether it matches — on
178
+ this camera a gain of 8 was accepted and read back as 0 while auto exposure was on. Measured with the earlier Python implementation; the Rust implementation in 0.0.3 has not yet been verified against the camera.
179
+
180
+ `plan_reset()` lists what differs and writes nothing; `reset_to_defaults()` writes those values — not yet
181
+ run against the camera. It leaves auto/manual modes alone. `snapshot()`/`restore()` undo your own changes.
182
+ The old OpenCV-style `cam.set_prop("CAP_PROP_EXPOSURE", -5)` goes through the same guard. It takes whole
183
+ numbers for integer controls: `set_prop("CAP_PROP_GAIN", 28.5)` raises `ValueError`.
184
+
185
+ On Windows the SDK talks to DirectShow directly (no extra dependency), and it reads controls while OpenCV
186
+ streams. If that fails, it falls back to OpenCV, which has no power line frequency, no
187
+ low-light compensation and no ranges — `cam.controls.backend_note` says so. The property page opened by
188
+ AMCap or `CAP_PROP_SETTINGS` writes outside the guard. Measured with the earlier Python implementation; the Rust implementation in 0.0.3 has not yet been verified against the camera.
189
+
190
+ ## IR illuminator
191
+
192
+ The illuminator is exposed as the UVC backlight-compensation control.
193
+
194
+ ```python
195
+ from opticmix_vision import LedControl
196
+
197
+ led = LedControl(cam) # cam is an open Device
198
+ led.set(96) # writes, and returns the driver's readback
199
+ ```
200
+
201
+ The ceiling of 96 was seen on two units; the dead zone and the onset were swept
202
+ on one. **0–16 is off** — no pixel rose more than 10 DN above the off frame.
203
+ Light first appears at **24** and grows to **96**. Values above 96 are ignored; 112, 128 and
204
+ 255 all read back as 96. So the usable range is 24–96, and the normalized
205
+ 0.0–1.0 interface takes `value_range=(0, 96)` and rounds to a whole number before writing.
206
+ The figures in this paragraph: measured with the earlier Python implementation; the Rust implementation in 0.0.3 has not yet been verified against the camera.
207
+
208
+ A readback only means the driver accepted the number. Check the image — and note
209
+ that frame mean is a poor check here, because the illuminator lights part of a
210
+ 185° (vendor spec) field: on one unit a lit patch went from 62 to 238 DN while the
211
+ frame mean moved 1.7 DN.
212
+
213
+ Illuminance, working distance and beam coverage have **not** been measured, so
214
+ this package publishes no such figures.
215
+
216
+ ## Without a camera
217
+
218
+ `opticmix_vision.synthetic` drives the viewer and the explorer with generated
219
+ frames (`python -m opticmix_vision.explorer --synthetic`), so the capture path
220
+ runs with nothing attached. It is a generator, not measured data. The examples
221
+ that open a camera, other than `quickstart.py`, take `--synthetic` as well;
222
+ `torch_dataloader.py` needs no camera — see [examples/README.md](https://github.com/Opticmix/opticmix-vision/blob/v0.0.3.post1/python/examples/README.md).
223
+
224
+ ## When something goes wrong
225
+
226
+ - **One eye goes black or stops moving.** On the units we have tested, one eye's
227
+ stream has occasionally stopped; re-inserting the USB cable brought it back.
228
+ `read()` raises `DeviceError` saying which eye once it has sent the byte-identical
229
+ image 90 frames in a row. Turn the check off with
230
+ `DeviceConfig.weevia_s1(stall_frames=0)`.
231
+ - **The frame rate is far below 90.** Check that the mode is MJPG (`cam.mode`).
232
+ - **"Weevia S1 not found".** The message lists the cameras Windows reported.
233
+ Re-insert the cable; if the camera is missing from the list, Windows does not
234
+ see it either. On Linux, pass `device=` and `backend="v4l2"` — see
235
+ Linux (experimental).
236
+ - **A setting did not stick.** Look at `result.kept` — see Camera controls.
237
+
238
+ ## Getting help
239
+
240
+ - Bugs and questions about the SDK: open an issue at
241
+ https://github.com/Opticmix/opticmix-vision/issues — include the output of
242
+ `cam.mode`, your OS, and the SDK version (`opticmix_vision.__version__`).
243
+ - Anything else, or if you cannot post publicly: contact@opticmix.kr
244
+
245
+ We reply to issues and email within 2 business days (Korea time).
246
+
247
+ ## What is in this package, and what is not
248
+
249
+ Run against the camera: capture, stereo split, the illuminator, and camera
250
+ controls — all fourteen read through the native path on one unit (with ranges
251
+ and defaults, while streaming). Native writes have been checked on one unit for power line
252
+ frequency and the auto-exposure mode; writes of exposure, gain and the
253
+ illuminator were checked earlier through OpenCV. Measured with the earlier Python implementation; the Rust implementation in 0.0.3 has not yet been verified against the camera.
254
+
255
+ **Not in this package:** calibration, rectification, depth and hand tracking.
256
+ The code for them exists but has not been validated for release, so it is
257
+ withheld rather than shipped with a warning label. Each returns when it has been.
258
+
259
+ ## Tests
260
+
261
+ From a checkout of the repository, in this folder (`python/`):
262
+
263
+ ```bash
264
+ pip install -e ".[dev]" # compiles the extension: needs Rust 1.88 or newer (and the MSVC build tools on Windows)
265
+ python -m pytest -q
266
+ ```
267
+
268
+ Hardware tests are skipped unless `OPTICMIX_HW=1` and a camera is attached.
269
+
270
+ ### Working from a checkout
271
+
272
+ Camera controls and device listing run in a compiled extension,
273
+ `opticmix_vision._core`, built from `../rust` with maturin. `pip install -e .`
274
+ compiles it. If this source tree is on the path without having been installed,
275
+ `import opticmix_vision` and frame capture still work, but camera controls and
276
+ device listing raise `ControlsUnavailable` with a message naming the missing
277
+ extension. Install the wheel into that environment as well.
278
+
279
+ ## License
280
+
281
+ Apache-2.0. See [LICENSE](https://github.com/Opticmix/opticmix-vision/blob/v0.0.3.post1/python/LICENSE). The compiled extension also contains Rust
282
+ crates under MIT / Apache-2.0; their notices are in
283
+ [THIRD_PARTY_NOTICES.txt](https://github.com/Opticmix/opticmix-vision/blob/v0.0.3.post1/python/THIRD_PARTY_NOTICES.txt).
284
+