Coder Social home page Coder Social logo

southeugeneroboticsteam / deepspace-2019-vision Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 2.12 MB

SERT's OpenCV code for the 2019 Deep Space game

License: GNU General Public License v3.0

Shell 22.31% Python 77.01% Dockerfile 0.68%
robot frc 2019 deepspace vision python opencv docker

deepspace-2019-vision's Introduction

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:

$ pip install -r requirements.txt

Then, you can run the program using:

$ python run.py

Full usage:

usage: run.py [-h] [-i IMAGE] [-s SOURCE] [-t TEAM] [-d] [-na MIN_AREA]
              [-xa MAX_AREA] [-nf MIN_FULL] [-xf MAX_FULL]
              [-l LOWER_COLOR [LOWER_COLOR ...]]
              [-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:

$ 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.

optional arguments:
  -h, --help            show this help message and exit
  -i IMAGE, --image IMAGE
                        path to image
  -s SOURCE, --source SOURCE
                        video source (default=0)
  -t TEAM, --team TEAM  the team of the target roboRIO
  -d, --display         display results of processing in a new window
  -na MIN_AREA, --min-area MIN_AREA
                        minimum area for blobs
  -xa MAX_AREA, --max-area MAX_AREA
                        maximum area for blobs
  -nf MIN_FULL, --min-full MIN_FULL
                        minimum fullness of blobs
  -xf MAX_FULL, --max-full MAX_FULL
                        maximum fullness of blobs
  -l LOWER_COLOR [LOWER_COLOR ...], --lower-color LOWER_COLOR [LOWER_COLOR ...]
                        lower color threshold in HSV
  -u UPPER_COLOR [UPPER_COLOR ...], --upper-color UPPER_COLOR [UPPER_COLOR ...]
                        upper color threshold in HSV
  -tn, --tuning         open in tuning mode
  -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:

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

deepspace-2019-vision's People

Contributors

andrewda avatar daniwhite avatar evanmhm avatar snowsignal avatar supercilex avatar verycumbersome avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

deepspace-2019-vision's Issues

Allow more options to be set over NetworkTables

Configuring settings such as Upper/Lower HSV values, whether to display camera feed (over CameraServer, see #1), etc would be super useful to use over NetworkTables. Eventually, this could escalate to a web interface.

Auto restart vision

Can simply add a while true loop in the start.sh script, or find a way to do it in init.d

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.