A program to track the angle of the scale using a webcam.
- Opening
run_dashboard.bat
launchesCheesyVision2.py
andfirstperson.html
(see First Person View). - Press D to cycle through cameras until the webcam is the active one.
- Click and drag to select the rectangular region-of-interest.
- The tighter the rectangle, the more accurate it will be; however, make sure that the entire range of the scale is included.
- If you'd like to change the RoI later, simply press R and drag a new rectangle.
- Click on the scale arm to select the purple color.
- You can click multiple times or drag the mouse to select multiple regions.
- Press F to freeze the video feed and make selection easier.
- If you misclick or make a mistake, press C to reset the color selection. You can also right-click to reset and then add the clicked color.
- Zero the scale by pressing Z.
- Make sure you wait for a moment when the scale is horizontal and the program sees the scale well. Press Z again at any time to re-zero.
Then the program's ready.
- left-click and drag: select the region-of-interest (RoI)
- D: switch cameras
- left-click (and optionally drag): add color(s)
- right-click: reset and add color
- C: reset color selection
- F: freeze the video
- R: go back to re-select the RoI
- Z: zero the scale measurement
- M: switch to manual color mode (default)
- A: switch to auto-color mode (the color range is automatically detected each frame)
You can see the list of command-line arguments by running:
$ python CheesyVision2.py --help
firstperson.html
displays a MJPEG feed from the First Person View Camera on the robot- Feed is streamed over Network Tables using the WPILib
MjpegServer
class