GithubHelp home page GithubHelp logo

2017vision's Introduction

2017 Vision

FRC Vision Processing using OpenCV Python

What you need

Python 2.7, NumPy and OpenCV

PyNetworkTables

Camera (Microsoft Lifecam HD-3000 for our purposes)

Calibration Mode

  1. Set a small centered rectangle as the calibration box (can change the size in constants)

  2. Get frame from camera

  3. Find average BGR value inside calibration box

  4. Convert BGR value to HSV value

  5. Print HSV values for every frame

Tracking Mode

  1. Get frame from camera

  2. Remove everything but specified color in frame

  3. Find contour for the largest object with the specified color (closest goal)

  4. Find centroid of that object (ideal position to shoot / drop off gear)

  5. Calculate error and convert from pixels to degrees

  6. If the center of the camera is aligned with the center x-axis of the object (goal), then it is ready to shoot / drop off gear.

  7. Send data over NetworkTables and print in terminal.

Testing

Testing has been done with

  • example images provided by WPILIB (2017 images included in this project under SampleImages)

    • Tests for all example images in the SampleImages folder successful except for images 7 and 32
  • custom made high goal / boiler / gear peg with green highlighter / marker

2017vision's People

Contributors

tedklin avatar

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.