Skip to main content

A modular and versatile Python package for Computer Vision object detection pipelines Tailored for robotics applications

Project description

Ovl-Python

Python Module for Computer Vision Object Tracking and Detection mainly for the FIRSTֲ® Robotics Competition Program You can follow up on changes in for the current version in the changelog folder There have been significant changes from the previous version - changelog

Dependencies:

The following python module dependencies are needed:

  • OpenCV

  • numpy

The following python modules are optional for certain features:

  • NetworkTables (pyNetworkTables) for NetworkTableConnection (installed automatically)

  • sklearn (scikit-learn) for HSVCalibration creation (not needed for use in Vision)

  • PySerial (pyserial) for SerialConnection

OVL is officially supported for python 3.5+!

Installation:

Using pip:
python -m pip install ovl

Usage:

The library uses simple yet highly customizable syntax to create a vision pipeline using the Vision object

A pipeline that detects a yellow circle:

import ovl

# filter contours that are larger than 200 pixels
# and are approximately a circle and then sort by size

contour_filters = [ovl.area_filter(min_area=200),
                   ovl.circle_filter(min_area_ratio=0.7),
                   ovl.dec_area_sort()] 

threshold = ovl.YELLOW_HSV # Define the wanted color to detect 

yellow_circle = Vision(threshold=threshold,
                       contour_filters=contour_filters,
                       camera=0, # open the first connected camera
                       image_filters=image_filters)

while True:
    image = yellow_circle.get_filtered_image()
    contours, filtered_image = yellow_circle.detect(image)
    directions = yellow_circle.get_directions(contours, filtered_image)
    
    print(directions) # prints out the (x, y) coordinates of the largest target




Documentation

The Hebrew and English documentation have been removed for being outdated all functions and classes now have in code documentation. This includes code examples, recommended usage reference to further documentation and more.

There are multiple code examples here

Simply use help on a class/function:

help(ovl.Vision)

help(ovl.contour_filter)

help(ovl.area_filter)


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ovl-2020.1.4.tar.gz (40.1 kB view details)

Uploaded Source

File details

Details for the file ovl-2020.1.4.tar.gz.

File metadata

  • Download URL: ovl-2020.1.4.tar.gz
  • Upload date:
  • Size: 40.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.5

File hashes

Hashes for ovl-2020.1.4.tar.gz
Algorithm Hash digest
SHA256 6e12ff00ebb95e47379cd10466cac423722c16e7643255af1699f534f61f0b92
MD5 7d7d287ab3581a7d7b2fe492128182f8
BLAKE2b-256 e6367999342cce81b3c685f44b3577729c378b8be130bccae298ec33b33fd5b9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page