Code Monkey home page Code Monkey logo

endercv's Introduction

Introduction

EnderCV is an OpenCV 3 package for the FIRST Tech Challenge that's designed to be relatively simple, and with an easier and more reliable setup.

Installation

Installation is simple; the instructions below add the EnderCV files as Gradle dependencies of your FTC robot controller app.

  1. Download this repo, either by cloning from Git or using the zip download.
  2. Pull up Android Studio, with the FTC application SDK open
  3. Navigate to File -> New -> Import Module from the title bar.
  4. When the a dialog comes up, asking for the module source directory, navigate to this repo and select the openCVLibrary320 folder, and then hit Finish
  5. Repeat steps 3 and 4 except instead of selecting the openCVLibrary320 folder, select the endercv folder instead.
  6. In the left hand side project explorer in Android Studio, right-click TeamCode, and click on Open Module Settings.
  7. A Project Struture dialog should come up. Click the Dependencies tab.
  8. Click the green plus sign on the right hand side, then Module dependency, and then :openCVLibrary320, then press OK.
  9. Repeat step 8, except substitute :openCVLibrary320 with :endercv
  10. Click OK to exit the Project Structure dialog.

And that's it!

Usage

This is a bit of a TODO right now. The examples folder has an example of an OpenCVPipeline class and an opmode using the class, which is a nice illustrative example. That particular example shows how OpenCV can be used to filter for a certain color, as a first step for searching and analysing targets (like a beacon, or a particle/jewel, or maybe even glyphs)

Updating

Here's a semi-hackish way to do it:

  1. Close Android Studio. Download the latest version of EnderCV either from a git pull or using the zip download.
  2. Navigate to the folder for the robot controller app project (the ftc_app folder) where EnderCV is installed.
  3. Delete the openCVLibrary3xx and endercv folders, where 3xx can be a number like 320.
  4. Copy the new versions of openCVLibrary3xx and endercv from the latest version of EnderCV into the RC app folder, to replace the deleted ones.
  5. Re-open Android Studio, and that should be it.

Resources

OpenCV with Java is not an easy thing to get around. However, there are some resources on the net from which one can do research and find help:

GRIP is a GUI tool to prototype vision pipelines, and can even export C++ or Java code. While the generated code is not the most readable, and the software is more FRC oriented, it is useful for showing how certain OpenCV functions work, as well as tweaking parameters.

This webpage meant for FRC gives a decent overview on how to identify targets with vision in general.

The unofficial FTC Discord and FRC Discord can also be useful as many people in the #programming of both servers are also working on vision.

Finally, search around and look at OpenCV documentation and examples. Object detection and tracking are widely covered subjects in many online tutorials. Some tweaking may be required to get things working in Java. As Java samples can be hard to find, consider looking at C++ samples, as those are often similar to how the Java bindings work, moreso than Python.

endercv's People

Contributors

guineawheek avatar

Watchers

 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.