Improve README clarity and add defaults to controls
- Expand Controls intro with two-panel layout description - Add brush size range/default and mask alpha range/default to tables - Split 'Starting-point shortcuts' (Load Prev Mask, Auto Segment) from mask editing table - Trim 'How it works' mask drawing section to remove implementation internals - Enable optical_flow_config_file in config.example.yaml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
27
README.md
27
README.md
@@ -140,7 +140,7 @@ Copy `config/clips.example.txt` as a starting point.
|
||||
|
||||
## Controls
|
||||
|
||||
The window shows the video on the left (auto-playing) and the survey panel on the right.
|
||||
The window is split into two panels: the **video canvas** on the left (~70% of the width) and the **survey panel** on the right. The video auto-plays as a looping preview. Drawing tools and mask controls are arranged above and beside the canvas; navigation buttons (**Previous / Next / Skip**) sit at the top.
|
||||
|
||||
### Tool modes
|
||||
|
||||
@@ -159,7 +159,7 @@ Three drawing tools are available in the tool row. The active tool is highlighte
|
||||
| Draw water mask | Click and drag on the video |
|
||||
| Erase mask | Toggle **Eraser** button (turns orange when active), then drag |
|
||||
| Brush preview | A white circle follows the cursor showing the current brush size |
|
||||
| Adjust brush size | **Brush size** slider; click **↺** to reset |
|
||||
| Adjust brush size | **Brush size** slider (2–50 px, default 5); click **↺** to reset |
|
||||
|
||||
### Polygon tool
|
||||
|
||||
@@ -183,7 +183,7 @@ Polygons are drawn as overlays and do not affect the mask until you use **Fill**
|
||||
| Innermost shape | Clicking inside nested shapes always fills the innermost (smallest) polygon containing the click |
|
||||
| Undo fill | **Undo** — each fill is a single undoable step |
|
||||
|
||||
### Common mask actions
|
||||
### Mask editing
|
||||
|
||||
| Action | How |
|
||||
|---|---|
|
||||
@@ -192,9 +192,14 @@ Polygons are drawn as overlays and do not affect the mask until you use **Fill**
|
||||
| Redo | **Redo** |
|
||||
| Clear entire mask | **Clear** |
|
||||
| Toggle mask overlay | **Hide Mask / Show Mask** — button turns red when hidden; does not affect mask data |
|
||||
| Mask transparency | **Mask Alpha** slider; click **↺** to reset |
|
||||
| Load mask from previous clip | **Load Prev Mask** — copies the saved mask of the previous clip; undoable with **Undo** |
|
||||
| Optical flow first guess | **Auto Segment** — runs automatic river segmentation and replaces the current mask; undoable with **Undo**. Only enabled when `optical_flow_config_file` is set in `config.yaml`. |
|
||||
| Mask transparency | **Mask Alpha** slider (0–100%, default 40%); click **↺** to reset |
|
||||
|
||||
### Starting-point shortcuts
|
||||
|
||||
| Action | How |
|
||||
|---|---|
|
||||
| Load mask from previous clip | **Load Prev Mask** — copies the saved mask of the previous clip onto the current one; undoable |
|
||||
| Optical flow first guess | **Auto Segment** — replaces the current mask with an automatic river segmentation; undoable. Only available when `optical_flow_config_file` is set in `config.yaml`. |
|
||||
|
||||
### Image display adjustments
|
||||
|
||||
@@ -264,15 +269,9 @@ Up to `max_frames` frames are extracted from the video and scaled so the longest
|
||||
|
||||
### Mask drawing
|
||||
|
||||
The mask is a binary NumPy array matching the display frame size.
|
||||
The mask is a binary array at display resolution. **Brush** strokes stamp a filled circle (draw or erase). **Polygon** shapes are stored as overlays and don't touch the mask until a **Fill** click rasterises them — the innermost polygon containing the click is filled, and any polygon whose centroid falls inside it is punched out as a hole.
|
||||
|
||||
**Brush:** each stroke stamps a filled circle of the selected radius, setting pixels to 1 (draw) or 0 (erase).
|
||||
|
||||
**Polygon:** vertices are stored as a list of floating-point canvas coordinates. Multiple closed shapes can coexist. Completed shapes are rendered as cyan overlays on the canvas but do not touch the mask until a fill is applied.
|
||||
|
||||
**Fill:** clicking inside a closed polygon rasterises it with `cv2.fillPoly` and ORs the result into the mask. Among all shapes containing the click, the innermost (smallest area, determined by `cv2.contourArea`) is selected as the fill target. Any polygon whose centroid lies inside the target is then punched out as a hole.
|
||||
|
||||
Every mask-changing operation (brush stroke, fill) pushes the previous mask onto the undo stack before modifying it. On save the mask is resized to the original video resolution with nearest-neighbour interpolation and written as an 8-bit PNG (0 or 255).
|
||||
Every mask-changing operation is pushed onto an undo stack before it executes. On save, the mask is upscaled to the original video resolution and written as an 8-bit PNG (0 or 255).
|
||||
|
||||
### Resuming
|
||||
|
||||
|
||||
Reference in New Issue
Block a user