Skip to content

Commit 7f32c0f

Browse files
kwagyemanclaude
andcommitted
docs: add OpenMV IDE user-guide chapter, drop decade-old IDE overview
21-page chapter under tools/ide/ covering the main window (editor, scripts/examples, connecting, running scripts, preferences), the frame buffer/histogram/recording views, terminals, firmware and ROMFS maintenance, the machine-vision tools (threshold, keypoints, tag generators, model zoo, dataset editor), the code profiler, and command-line options. All claims verified against the openmv-ide plugin source. Screenshot placeholders mark images to capture. Removes openmvcam/tutorial/openmvide_overview.rst and points software_setup.rst at the new chapter. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent f49f4a5 commit 7f32c0f

24 files changed

Lines changed: 1394 additions & 414 deletions

docs/openmvcam/tutorial/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ earlier, it links back.
2828
overview.rst
2929
software_setup.rst
3030
hardware_setup.rst
31-
openmvide_overview.rst
3231

3332
python/index.rst
3433
hardware/index.rst

docs/openmvcam/tutorial/openmvide_overview.rst

Lines changed: 0 additions & 406 deletions
This file was deleted.

docs/openmvcam/tutorial/software_setup.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ Software Setup
22
==============
33

44
Before you can start using your OpenMV Cam you'll need to download and install
5-
`OpenMV IDE <https://openmv.io/pages/download/>`_.
5+
`OpenMV IDE <https://openmv.io/pages/download/>`_. This page covers getting it
6+
installed and running on each platform; the IDE itself -- the editor, the frame
7+
buffer viewer, the camera tools -- has its own :doc:`chapter
8+
<tools/ide/index>`.
69

710
Windows
811
-------
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
Command-line options
2+
====================
3+
4+
The ``openmvide`` executable takes command-line options
5+
that automate what the GUI normally does interactively
6+
-- the basis for kiosk installations, demo machines,
7+
production test stations, and any setup where the IDE
8+
should come up connected and running with nobody at the
9+
keyboard.
10+
11+
Automated startup
12+
-----------------
13+
14+
The automation flags compose into a launch that needs
15+
no clicks:
16+
17+
* ``-auto_connect`` -- connect to the camera on
18+
startup, and keep reconnecting whenever one appears
19+
(the Auto Reconnect option, forced on).
20+
* ``-auto_update <release|development|path>`` -- on
21+
connect, install the bundled release firmware, the
22+
latest development firmware, or a specific firmware
23+
file, without prompting.
24+
* ``-auto_erase`` -- erase the internal flash
25+
filesystem during the automatic update.
26+
* ``-auto_run`` -- start the open script as soon as the
27+
connection is up.
28+
* ``-disable_stop`` -- force the Stop Script on
29+
Connect/Disconnect option off and lock it, so the
30+
IDE attaching or detaching never halts the script
31+
already running on the camera.
32+
* ``-full_screen`` -- start with the main window full
33+
screen.
34+
* ``-serial_number_filter <serial>`` -- only connect to
35+
the camera with the given USB serial number; with
36+
several cameras attached, each IDE instance can be
37+
pinned to one unit.
38+
39+
So ``openmvide -auto_connect -auto_run -full_screen``
40+
turns a PC and a camera into an appliance: power on,
41+
IDE appears full screen, camera connects, script runs,
42+
preview streams.
43+
44+
Viewer mode
45+
-----------
46+
47+
``-viewer_mode`` starts the application as *OpenMV
48+
Viewer*: the editor and the run controls are gone, and
49+
what remains is the frame buffer, the histogram, and
50+
the serial output of whatever the camera is already
51+
running. It is the mode for the person who should see
52+
the camera but not change it -- a monitoring station on
53+
a line, a demo the audience cannot edit.
54+
55+
Terminal-only windows
56+
---------------------
57+
58+
The terminal flags skip the main window entirely and
59+
open a standalone :doc:`terminal window <open-terminal>`
60+
straight from the command line:
61+
62+
* ``-open_serial_terminal <port:baud>``
63+
* ``-open_tcp_client_terminal <host:port>`` /
64+
``-open_tcp_server_terminal <port>``
65+
* ``-open_udp_client_terminal <host:port>`` /
66+
``-open_udp_server_terminal <port>``
67+
68+
In a standalone terminal the run button executes the
69+
camera's stored ``/main.py``.
70+
71+
Utility flags
72+
-------------
73+
74+
``-list_ports`` prints one line of key/value fields
75+
per camera serial port (name, description, vendor and
76+
product IDs, serial number) to standard output and
77+
exits -- the hook for scripts that need to discover
78+
cameras before launching something else.
79+
``-update_resources`` forces the IDE to rebuild its
80+
bundled resources (examples, firmware, documentation)
81+
as it starts, and ``-language <locale>`` overrides the
82+
user-interface language.
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
Connecting a camera
2+
===================
3+
4+
The connect button -- the plug icon at the bottom of
5+
the left toolbar, or ``Ctrl+E`` -- is how every session
6+
starts. Clicking it scans the USB serial ports for
7+
cameras and connects to the one it finds. With more
8+
than one camera attached, a dialog asks which serial
9+
port to use, preselecting the previous pick; with
10+
none, the IDE says so and offers a recovery path for a
11+
camera that no longer enumerates (see
12+
:doc:`firmware`).
13+
14+
What happens on connect
15+
-----------------------
16+
17+
Connecting is more than opening a serial port. The IDE
18+
identifies the board, reads its firmware version, and
19+
compares it against the release bundled with the IDE.
20+
If the camera's firmware is older, a prompt offers to
21+
update it -- the normal way cameras get firmware
22+
updates is exactly this prompt. The update dialog
23+
includes checkboxes to also erase the internal flash
24+
filesystem and to reset the ROM file system; they
25+
start off, remember the last choice made, and neither
26+
is normally needed for an update. After the first
27+
successful connect the IDE also shows a one-time
28+
dialog explaining what the camera's LED blink colours
29+
mean.
30+
31+
A camera that is attached in bootloader (DFU) mode
32+
rather than as a normal serial device gets its own
33+
dialog on connect, with options to install the latest
34+
release firmware, load a specific firmware file, erase
35+
the internal flash filesystem, or edit or reset the ROM
36+
file system.
37+
38+
Two platform notes. On Windows, the IDE checks the
39+
system device list during connect and reports USB
40+
driver problems it finds, with the device names
41+
involved. On Linux, a permission error opening the
42+
serial port almost always means the user is not in the
43+
``dialout`` group; the error dialog shows the exact
44+
``adduser`` command to fix it.
45+
46+
The status bar
47+
--------------
48+
49+
Once connected, the status bar along the bottom right
50+
of the window becomes the camera's dashboard:
51+
52+
* *Board* -- the board type reported by the camera.
53+
* *Sensor* -- the attached camera sensor module.
54+
* *Firmware Version* -- the running firmware version.
55+
Clicking it re-checks the version against the bundled
56+
release and offers an update if one is available.
57+
* *Serial Port* -- the port the connection is using.
58+
* *Drive* -- the flash-drive mount point associated
59+
with the camera. Clicking it opens the drive in the
60+
platform's file manager, or -- when several
61+
candidate drives are attached -- asks which one
62+
belongs to the camera, remembering the answer per
63+
serial port. A camera connects and runs scripts fine
64+
without a drive association; only the drive-dependent
65+
actions, like opening the drive folder and saving a
66+
script as ``main.py``, stay disabled until one is
67+
set.
68+
* *FPS* -- the rate at which frames are arriving at the
69+
IDE. This is the preview rate, not necessarily the
70+
camera's capture rate -- a script can run faster than
71+
the USB link can stream its frames.
72+
73+
.. admonition:: Screenshot needed
74+
75+
``figures/status-bar.png`` -- the bottom edge of the
76+
main window with a camera connected, showing the
77+
board, sensor, firmware version, serial port, drive,
78+
and FPS entries populated. Crop to the status bar.
79+
80+
An *Unregistered* button also appears in the status
81+
bar for boards that require a one-time product
82+
registration, and the IDE offers the registration
83+
automatically on connect; once the camera is
84+
registered the button goes away.
85+
86+
Disconnecting is forgiving. Clicking disconnect is the
87+
tidy way out, but unplugging the cable works too -- the
88+
IDE notices the camera is gone (or has stopped
89+
responding) and disconnects on its own.
90+
91+
Auto reconnect
92+
--------------
93+
94+
Tools → Auto Reconnect to OpenMV Cam makes connection
95+
fully automatic: whenever a camera is detected on USB
96+
the IDE connects to it, and the manual connect and
97+
disconnect buttons are disabled while the option is
98+
active. With one camera and one IDE this is the
99+
convenient mode -- plug the camera in and it is
100+
connected. Turn it off when juggling several cameras or
101+
sharing the port with another program.
102+
103+
The related Tools → Stop Script on Connect/Disconnect
104+
option (on by default) halts any running script when
105+
the IDE attaches or detaches, so a freshly connected
106+
camera is always in a known idle state. Turning it off
107+
lets a camera keep executing its stored script while
108+
the IDE connects to observe it.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
The dataset editor
2+
==================
3+
4+
Training a custom classifier starts with a labelled
5+
dataset -- hundreds of images of each thing the model
6+
should recognise, captured by the camera that will run
7+
it, sorted into one folder per class. The dataset
8+
editor is the IDE's capture workflow for building one.
9+
10+
Tools → Dataset Editor → New Dataset asks for a folder
11+
to build the dataset in -- warning that a non-empty
12+
folder's contents will be deleted -- and sets it up: a
13+
file browser pane docks on the left of the main
14+
window, and a capture script
15+
(``dataset_capture_script.py``) opens in the editor.
16+
The script is a plain capture loop, and it is meant to
17+
be edited -- apply the
18+
same lens correction, cropping, or filtering the
19+
deployed application will use, so the model trains on
20+
the images it will actually see. Open Dataset reopens
21+
an existing dataset folder later, and Close Dataset
22+
puts the window back to normal.
23+
24+
.. admonition:: Screenshot needed
25+
26+
``figures/dataset-editor.png`` -- the main window
27+
with a dataset open: the dataset pane on the left
28+
showing two or three class folders with a few
29+
captured images, the image preview below it, and the
30+
capture script in the editor. Crop to show the
31+
dataset pane and part of the editor.
32+
33+
Capturing
34+
---------
35+
36+
While a dataset is open, two buttons join the toolbar
37+
on the window's left edge, below the run controls.
38+
*New Class Folder* (``Ctrl+Shift+N``) creates a class
39+
-- one per category the model should learn, named for
40+
the label.
41+
With the capture script running and a class folder
42+
selected, *Capture Data* (``Ctrl+Shift+S``) saves the
43+
current frame buffer image into that class, and the
44+
preview pane under the file browser shows each capture
45+
as it lands.
46+
47+
The capture rhythm is: select a class, point the camera
48+
at an example of it, capture; move the object, vary the
49+
angle, the distance, the background, the lighting,
50+
capture again -- variation in the dataset is what buys
51+
robustness in the model. Repeat per class, including a
52+
background class of scenes containing none of the
53+
targets if the application needs to know when nothing
54+
is there.
55+
56+
Exporting and training
57+
----------------------
58+
59+
The Export submenu sends the finished dataset to
60+
training. Export Dataset to Zip File packs it into an
61+
archive with class-prefixed file names -- the neutral
62+
format every training service and framework accepts.
63+
For Edge Impulse, the IDE integrates directly: log in
64+
to an Edge Impulse account from the same submenu, and
65+
Upload to Edge Impulse Project pushes the dataset
66+
straight into a project (an API-key upload exists for
67+
accounts where the email-and-password login is not an
68+
option).
69+
Train there, export the model, and the :doc:`NPU
70+
converter <model-zoo>` makes it camera-ready when the
71+
board needs it.
72+
73+
.. seealso::
74+
75+
The :doc:`machine learning chapter
76+
<../../ml/index>` for the training workflow the
77+
dataset feeds into.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
The script editor
2+
=================
3+
4+
The editor is a full professional text editor -- the
5+
same Qt Creator core that ships in commercial IDEs --
6+
trimmed to a tabbed, single-window layout so that the
7+
script about to run is always the one in front. Most of
8+
it needs no explanation: tabs along the top switch
9+
between open files, and the usual file and edit
10+
operations live in the File and Edit menus and on the
11+
toolbar buttons along the left edge. The features below
12+
are the ones worth knowing about specifically for
13+
MicroPython work.
14+
15+
Whitespace and undo
16+
-------------------
17+
18+
Indentation is syntax in Python, so the editor can
19+
render whitespace visibly -- toggle Visualize
20+
Whitespace under Edit → Advanced when a script fails
21+
with an ``IndentationError`` that is invisible in the
22+
source. Undo and redo are unlimited and tracked per
23+
file across all open files.
24+
25+
Find and replace
26+
----------------
27+
28+
The find and replace bar (``Ctrl+F``) supports plain
29+
text, whole-word, and regular-expression matching, with
30+
capture groups available in the replacement text and an
31+
option to preserve the case of each replaced match.
32+
*Advanced Find* (``Ctrl+Shift+F``) widens the scope
33+
from the current file to all open files or to every
34+
file under a folder on disk, and presents the matches
35+
as a clickable result list.
36+
37+
Code completion and call tips
38+
-----------------------------
39+
40+
The editor knows the camera's Python API. Typing ``.``
41+
after a module or object name opens a completion list
42+
of its functions, methods, and constants; once a name
43+
is chosen, a call tip walks through the arguments.
44+
Hovering over any API name shows its documentation in a
45+
tooltip -- the same text as the library reference,
46+
without leaving the editor. Completion covers the
47+
camera-specific modules (:mod:`csi`, :mod:`image`,
48+
:mod:`machine`, and the rest of the library reference)
49+
in addition to the Python language itself.
50+
51+
A bundled Python language server checks the code as it
52+
is typed, underlining undefined names, unused imports,
53+
and syntax errors in the editor before the script ever
54+
runs -- a whole class of typo crashes caught at the
55+
desk instead of on the camera.
56+
57+
Threshold tuples get the same treatment in reverse:
58+
select a grayscale or LAB threshold tuple in a script,
59+
right-click it, and the context menu offers to open it
60+
in the threshold editor, which writes the tuned values
61+
back into the script when confirmed with OK.
62+
63+
.. admonition:: Screenshot needed
64+
65+
``figures/editor-completion.png`` -- the editor with
66+
a completion popup open after typing ``img.`` in a
67+
script, showing the method list and one entry's
68+
documentation tooltip. Crop to the editor pane.
69+
70+
GitHub Copilot
71+
--------------
72+
73+
The editor ships with GitHub Copilot support for inline
74+
AI code suggestions. It stays dormant until a GitHub
75+
account with a Copilot subscription is signed in, under
76+
the Copilot section of the preferences dialog; sign out
77+
or untick its enable box to switch it off.
78+
79+
Beyond Python files
80+
-------------------
81+
82+
The editor opens more than scripts. An image file
83+
opens in an image viewer with zoom and fit-to-screen
84+
controls -- handy for inspecting saved snapshots and
85+
templates without leaving the IDE -- and a binary file
86+
opens in a hex editor, useful for a quick look inside
87+
a recording or a descriptor file.
88+
89+
Editing outside the IDE
90+
-----------------------
91+
92+
Scripts are plain ``.py`` files, and nothing requires
93+
them to be edited in the IDE. When a file open in the
94+
editor changes on disk -- saved from another editor,
95+
pulled from version control -- the IDE picks the
96+
change up when its window regains focus and reloads
97+
the file, asking first only when the copy in the
98+
editor has unsaved changes of its own.

0 commit comments

Comments
 (0)