Multicam: draw the selected detection on other cameras without switching first#1737
Merged
Conversation
…ing first Previously, after drawing a line or rectangle on one camera during manual creation, annotating the other camera required clicking it (switching the selected camera) and re-entering edit mode before drawing. Now, while in edit mode, any non-selected camera missing the selected track's geometry at the current frame keeps a live creation cursor, so the detection can be drawn on each camera in turn -- e.g. two more clicks to place the line on the other stereo camera -- committed under the same track id. Implementation: - LayerManager: new cameraAwaitingGeometry() complements the existing isCreatingNewDetection() (brand-new track) mechanism, both for enabling the creation cursor on non-selected cameras and for routing a landed draw. The routing creates the same-id track on the drawn-on camera BEFORE calling selectCamera, so selectCamera skips its trackEdit toggle (which would finalize and discard an in-progress 1-point line replica, breaking 2-click completion). - Viewer: changeCamera no longer consumes a left-mousedown on a camera awaiting geometry (that click starts the draw). Right-click switching and the camera dropdown are unaffected. Point/segmentation mode is excluded; segmentation has its own cross-camera machinery.
Two fixes for point-click segmentation on stereo/multicam datasets: 1. Segmentation prompt points (the green/red click markers) were rendered by every camera's layer manager with no camera filter, so each click also drew its marker on the other camera at the same pixel location -- which looked like an unwarped point being auto-created there, regardless of the auto-compute setting or calibration. The markers now render only on the selected camera. 2. Point mode was excluded from cross-camera continuation drawing. Now a single click on the other camera starts a segmentation there for the same track id: 'awaiting geometry' for Point mode means the camera has no segmentation polygon yet (so a box-only detection still accepts a click), and a new segmentationFinalizePending handler -- invoked on any camera switch -- locks in the pending mask on the source camera and clears the recipe's accumulated prompt points, which belong to the source camera's image and must not leak into the other camera's prediction. Unlike the right-click confirm path it does not deselect, so the flow continues uninterrupted. The predict image path already resolves the selected camera at call time, so post-switch predictions run against the correct camera's image. Line, rectangle, and polygon continuation behavior is unchanged.
Member
Author
|
Added a second commit extending the continuation mechanism to point-click segmentation:
Line/rectangle/polygon continuation behavior is unchanged. |
…ing first Previously, after drawing a line or rectangle on one camera during manual creation, annotating the other camera required clicking it (switching the selected camera) and re-entering edit mode before drawing. Now, while in edit mode, any non-selected camera missing the selected track's geometry at the current frame keeps a live creation cursor, so the detection can be drawn on each camera in turn -- e.g. two more clicks to place the line on the other stereo camera -- committed under the same track id. Implementation: - LayerManager: new cameraAwaitingGeometry() complements the existing isCreatingNewDetection() (brand-new track) mechanism, both for enabling the creation cursor on non-selected cameras and for routing a landed draw. The routing creates the same-id track on the drawn-on camera BEFORE calling selectCamera, so selectCamera skips its trackEdit toggle (which would finalize and discard an in-progress 1-point line replica, breaking 2-click completion). - Viewer: changeCamera no longer consumes a left-mousedown on a camera awaiting geometry (that click starts the draw). Right-click switching and the camera dropdown are unaffected. Point/segmentation mode is excluded; segmentation has its own cross-camera machinery.
Two fixes for point-click segmentation on stereo/multicam datasets: 1. Segmentation prompt points (the green/red click markers) were rendered by every camera's layer manager with no camera filter, so each click also drew its marker on the other camera at the same pixel location -- which looked like an unwarped point being auto-created there, regardless of the auto-compute setting or calibration. The markers now render only on the selected camera. 2. Point mode was excluded from cross-camera continuation drawing. Now a single click on the other camera starts a segmentation there for the same track id: 'awaiting geometry' for Point mode means the camera has no segmentation polygon yet (so a box-only detection still accepts a click), and a new segmentationFinalizePending handler -- invoked on any camera switch -- locks in the pending mask on the source camera and clears the recipe's accumulated prompt points, which belong to the source camera's image and must not leak into the other camera's prediction. Unlike the right-click confirm path it does not deselect, so the flow continues uninterrupted. The predict image path already resolves the selected camera at call time, so post-switch predictions run against the correct camera's image. Line, rectangle, and polygon continuation behavior is unchanged.
…deselect, stereo startup Three fixes for stereo/multicam annotation editing: - Edit mode is now active on every camera showing the selected track, not just the selected one, so a stereo detection can be adjusted on either camera without selecting it first. The mousedown that grabs an edit handle switches the selected camera (preserving edit mode since the track exists there) without preventDefault killing the drag, and the edit-layer reset is deferred while the button is held. A routing fallback commits edits from a non-selected camera to that camera's own track. - A right-click while editing now finalizes and deselects the detection in a single press, matching single-camera behavior, instead of merely switching cameras and leaving it selected until a second right-click. Also fixes finalizeInProgress emitting the garbage GeoJS trace for a LineString still in creation mode (the real feature lives in shapeInProgress), which could commit a bogus line. - Interactive stereo startup no longer silently fails to produce lengths. Entering a sequence with a stereo feature on shows the persistent, annotation-blocking loading dialog until the service is ready; enable failures are always surfaced instead of degrading silently; and if a measurement is requested while the service is wanted but not running, the handler kicks off the enable itself and waits, so drawing a line always forces the service up rather than producing no measurement.
44ff630 to
26663be
Compare
Member
Author
|
Rebased on top of
|
…ning A failed cross-camera transfer showed two popups in sequence: the 'Computing stereo correspondence...' loading dialog flashed and vanished on its own, immediately followed by a separate 'Stereo Transfer Error' prompt. Reuse the loading dialog's own error state instead -- the spinner morphs in place into the error (title + message + Close) rather than hiding and spawning a second dialog. A transfer that finds no stereo match is a common, recoverable event, so its alert is now a softer 'warning' (amber) rather than the hard red 'error' reserved for service-startup failures.
A right-click near the head/tail line of a tight (skinny) bounding box lands inside both the rectangle polygon and the line feature, so RectangleLayer and LineLayer both emit annotation-right-clicked for the one physical click. Both are wired to Clicked -> handler.trackEdit, which toggles edit mode, so the second emit immediately undid the first: the detection entered line edit mode and then dropped straight back to merely selected. Add a same-tick guard in Clicked (mirroring the existing justFinalizedCreation flag): the first emit for a physical click is handled and any further emits in the same synchronous tick are ignored, cleared on the next macrotask so distinct user clicks are unaffected. Both overlapping features belong to the same track, so first-wins is unambiguous.
Collaborator
|
I've made some updates to resolve some minor issues and some other fixes:
|
BryonLewis
approved these changes
Jul 3, 2026
BryonLewis
left a comment
Collaborator
There was a problem hiding this comment.
Tested and made some updates to fix minor issues and some nagging UI/UX issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
In multicam/stereo manual annotation, after drawing a line (or rectangle) on one camera, drawing it on the other camera required left-clicking that camera (switching the selected camera, which also dropped edit mode) and re-entering creation mode. For stereo measurement workflows this adds several clicks per detection.
Change
While in edit mode, any non-selected camera that is missing the selected track's geometry at the current frame now keeps a live creation cursor. Drawing there commits to that camera under the same track id — so a line drawn on the left camera can immediately be placed on the right camera with two more clicks.
This generalizes the existing "seamless multicam creation" mechanism (which handled brand-new tracks with no geometry anywhere) to the continuation case.
Implementation
LayerManager.vuecameraAwaitingGeometry()helper — true when, in edit mode, the selected track has no geometry on this camera at this frame (or doesn't exist on it). ComplementsisCreatingNewDetection().updateLayers: the non-selected-camera creation-cursor branch now also fires for this case.update:geojsonrouting: for the continuation case, the same-id track is created on the drawn-on camera beforeselectCamerais called. Ordering matters: since the track then exists,selectCameraskips itstrackEdittoggle — which would callfinalizeInProgress()and discard the in-progress 1-point line replica, breaking the 2-click line completion. The brand-new-track path (trackAdd()) is unchanged.Viewer.vuechangeCamerano longer consumes a left-mousedown on a camera awaiting geometry (that click is the start of a draw there). Right-click camera switching (mouseup.right) and the camera dropdown are unaffected. Escape exits edit mode, restoring normal left-click switching.Point/segmentation mode is excluded from all of the above — segmentation has its own cross-camera machinery (stereo warp).
Side benefit: when the second camera's line completes,
onStereoAnnotationCompletefires as usual, so with "update lengths when modified" enabled the stereo length is computed immediately once both sides have lines.Verification
eslintclean on both files.yarn test: 197 passed / 2 failed — the failures are identical on the pristine tree (Electron install + missingFileglobal in the node test env), unrelated to this change.