项目作者: SouthEugeneRoboticsTeam

项目描述 :
SERT's OpenCV code for the 2019 Deep Space game
高级语言: Python
项目地址: git://github.com/SouthEugeneRoboticsTeam/DeepSpace-2019-Vision.git
创建时间: 2019-01-05T17:00:12Z
项目社区:https://github.com/SouthEugeneRoboticsTeam/DeepSpace-2019-Vision

开源协议:GNU General Public License v3.0

下载


Archived. See vision repo for game-agnostic code.


Logo


team 2521
team 2521
team 2521
team 2521

Usage

Before starting the program, you must install OpenCV >= v3.1.x along with
the pip dependencies:

  1. $ pip install -r requirements.txt

Then, you can run the program using:

  1. $ python run.py

Full usage:

  1. usage: run.py [-h] [-i IMAGE] [-s SOURCE] [-t TEAM] [-d] [-na MIN_AREA]
  2. [-xa MAX_AREA] [-nf MIN_FULL] [-xf MAX_FULL]
  3. [-l LOWER_COLOR [LOWER_COLOR ...]]
  4. [-u UPPER_COLOR [UPPER_COLOR ...]] [-tn] [-v]

Usage with Docker

If you are using Docker, the installation process is much easier.

Note: due to the sizes of the images that are installed as part of the build process, it is recommended to have a few GB of hard disk space available when building.

First, cd to this repository and then run docker build . -t vision. All existing config files will be used in the build process to make the image.

This will produce a docker image which can be run using:

  1. $ docker run --device /dev/video0 vision

Make sure that you have a camera connected before running this!

Connection Status GUI

SERT’s vision software comes with a connection status GUI to help debug
connection issues. This GUI can be displayed on a monitor connected to
the co-processor. We use an Adafruit 5” screen.

  • RADIO checks connection to the robot’s radio (at 10.XX.XX.1)
  • ROBOT checks connection to the roboRIO (at 10.XX.XX.2)
  • NTABL checks connection to the NetworkTables server on the roboRIO
Good Warning Bad
Connection is good and system is ready. Some connections are down. No connection. Ensure ethernet is plugged in.
good good good

Configuration

Command-Line Options

All command-line arguments may be configured in the config.ini file
(located at config/config.ini). For example, the --lower-rgb
argument may be edited using the lower-rgb line in the config.ini.

  1. optional arguments:
  2. -h, --help show this help message and exit
  3. -i IMAGE, --image IMAGE
  4. path to image
  5. -s SOURCE, --source SOURCE
  6. video source (default=0)
  7. -t TEAM, --team TEAM the team of the target roboRIO
  8. -d, --display display results of processing in a new window
  9. -na MIN_AREA, --min-area MIN_AREA
  10. minimum area for blobs
  11. -xa MAX_AREA, --max-area MAX_AREA
  12. maximum area for blobs
  13. -nf MIN_FULL, --min-full MIN_FULL
  14. minimum fullness of blobs
  15. -xf MAX_FULL, --max-full MAX_FULL
  16. maximum fullness of blobs
  17. -l LOWER_COLOR [LOWER_COLOR ...], --lower-color LOWER_COLOR [LOWER_COLOR ...]
  18. lower color threshold in HSV
  19. -u UPPER_COLOR [UPPER_COLOR ...], --upper-color UPPER_COLOR [UPPER_COLOR ...]
  20. upper color threshold in HSV
  21. -tn, --tuning open in tuning mode
  22. -v, --verbose for debugging, prints useful values

Camera

For use with the Microsoft Lifecam 3000, the camera’s exposure should be
set manually because the Lifecam will auto-adjust otherwise, making
thresholding difficult. This can be done with V4L:

  1. $ sudo apt-get install v4l-utils
  2. $ v4l-ctl -d /dev/video0 -c exposure_auto=1 # 1=DISABLED, 3=ENABLED
  3. $ v4l-ctl -d /dev/video0 -c exposure_absolute=50