Skip to content

Add Camera-Stream Crosshairs - #260

Open
EmeraldWither wants to merge 27 commits into
Gold872:mainfrom
EmeraldWither:feature-crosshair
Open

Add Camera-Stream Crosshairs#260
EmeraldWither wants to merge 27 commits into
Gold872:mainfrom
EmeraldWither:feature-crosshair

Conversation

@EmeraldWither

@EmeraldWither EmeraldWither commented Apr 29, 2025

Copy link
Copy Markdown
Contributor

Resolves #226.

Allows users to create a crosshair with an x, y, thickness, height, width, and color.

image

Todo:

  • add relevant options in widget properties window to allow user to customize
  • save options
  • double check all tests and write new ones
  • double check any possible performance impacts

@github-actions github-actions Bot added the GUI Changes to Elastic's UI label Apr 29, 2025
@EmeraldWither
EmeraldWither marked this pull request as draft April 29, 2025 03:22
@codecov

codecov Bot commented May 5, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.70588% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.12%. Comparing base (3c934b8) to head (b932bcf).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../widgets/nt_widgets/multi_topic/camera_stream.dart 64.70% 48 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #260      +/-   ##
==========================================
- Coverage   78.30%   78.12%   -0.18%     
==========================================
  Files          93       93              
  Lines        9439     9570     +131     
==========================================
+ Hits         7391     7477      +86     
- Misses       2048     2093      +45     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@EmeraldWither

Copy link
Copy Markdown
Contributor Author

I am not going to lie, I am not quite sure how to test custom painters. From what I have seen online, the main way to do it is to have an image that has the specific overlay from the CustomPainter already done, and to then compare it pixel by pixel during the test.

@EmeraldWither
EmeraldWither marked this pull request as ready for review May 6, 2025 00:32
@EmeraldWither

Copy link
Copy Markdown
Contributor Author

Updated settings page
image

@Gold872
Gold872 force-pushed the feature-crosshair branch from f3b8d8f to b0fabcf Compare May 21, 2025 23:55

@Gold872 Gold872 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

I can see where this feature would be useful, however I'm not sure whether it makes sense for the dashboard to implement positioning and highly detailed controls over thickness and appearance. For most scenarios, this would already be done by a camera coprocessor.

I'd like to hear your thoughts on this, it's not a matter of complexity, but a matter of whether it fits within the needs of a driver dashboard

Comment thread lib/widgets/mjpeg.dart Outdated
Comment thread lib/widgets/nt_widgets/multi_topic/camera_stream.dart Outdated
Comment thread lib/widgets/nt_widgets/multi_topic/camera_stream.dart Outdated
@EmeraldWither

Copy link
Copy Markdown
Contributor Author

I think that it should be a feature on the dashboard for a few reasons
A) Most vision system crosshairs are about putting a crosshair on the target, or to offset data from the target, not as much about putting a crosshair around an image (for example, the crosshair feature on photonvision only puts a thin green crosshair in the center that can't be changed at all)
B) As an example from my team, we used a lifecam as a camera to align our donut climber to the cage. Since it was directly connected to the RoboRIO, the only way to add a crosshair would be to manually code it in, whereas a dashboard can let us customize it easily. Plus, for us, it would be good to have a crosshair off-centered so we knew where to align our robot to the cage before committing to the climb
C) In most cases, if you are needing a crosshair, its probably because you dont have an auto-align or super-advanced vision, so in that case you will most likely not be using a co-processer

Just my thoughts.

@EmeraldWither
EmeraldWither requested a review from Gold872 May 27, 2025 17:16
@Gold856

Gold856 commented Aug 9, 2025

Copy link
Copy Markdown
Contributor

however I'm not sure whether it makes sense for the dashboard to implement positioning and highly detailed controls over thickness and appearance. For most scenarios, this would already be done by a camera coprocessor.

I've always wanted a dashboard that handled crosshairs, even before becoming a PV maintainer and having substantial reason to not want to implement customizable crosshairs ;)

On the technical side, crosshairs that are embedded in the camera stream itself kinda suck. They're a lossy operation on the image (meaning you can't feed the image back into an AprilTag detector and get the same results), and at low resolutions (which are common due to bandwidth limitations), the crosshair is both barely visible and takes up way more space than it deserves to. Moving the crosshair to the dashboard side would allow greater flexibility than having it embedded in the video stream.

@EmeraldWither

Copy link
Copy Markdown
Contributor Author

I give up on trying to get the formatting to work 😭.

@EmeraldWither

Copy link
Copy Markdown
Contributor Author

Any idea if this feature will be included or any changes should be made?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GUI Changes to Elastic's UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to add crosshair on CameraPublisher

3 participants