Giter Club home page Giter Club logo

line-segment-detector's Introduction

Vision Module

This is the vision module used for the RoboCup Humanoid League. The vision can be used to detect various features on the soccer field, such as lines and a ball.

Getting Started

Requirements

This module has the following requirements:

  1. OpenCV 3.2+
  2. Python 2.7

Features

This module has three major features:

  1. Filtering out the background
  2. Detecting a solid colour ball
  3. Detecting line segments and determining parts of the field

How to run the project

cd <project root directory>
python vision/src/vision.py

The vision can be tuned via the GUI. To start, select the desired object to tune using the Object trackbar in the debug window. Change the average colour space value by selecting a range in the camera window. Modify the threshold values via the other three trackbars.

Configuration

This module has a configuration file under config/configuration.json. Use this file to tune the vision based on the environment it is used in.

The configuration file gives the ability to change the setting of the camera image and the detected features.

Camera:

  • camera_index: the index of the video camera device (default: 0)
  • resized_frame_height: height of the resized frame, useful to reduce processing load (default: 320)

Ball:

  • min_area: minimum area of contours (default: 20)
  • max_area: maximum area of contours (default: 4000)
  • output_ball_colour: line colour of the ball in the output frame (default: green)
  • threshold: value added to calculate the min/max range of the colour space (default: [0, 0, 0])
  • value: average value of the selected range in the colour space (default: [0, 0, 0])

Field:

  • min_area: smallest contour area to consider as part of the field (default: 1500)
  • threshold: value added to calculate the min/max range of the colour space (default: [0, 0, 0])
  • value: average value of the selected range in the colour space (default: [0, 0, 0])

Lines:

  • corner_max_distance_apart: maximum distance between lines to be consider as a corner (default: 20)
  • max_distance_apart: maximum distance between line segments to be considered as a line (default: 20)
  • max_width: maximum width of each line (default: 20)
  • min_length: minimum length of each line segment (default: 20)
  • output_boundary_line_colour: line colour of the boundary lines in the output frame (default: blue)
  • output_center_line_colour: line colour of the center line in the output frame (default: cyan)
  • output_goal_area_line_colour: line colour of the goal area lines in the output frame (default: magenta)
  • output_undefined_line_colour: line colour of any lines that can not be classified (default: red)
  • threshold: value added to calculate the min/max range of the colour space (default: [0, 0, 0])
  • value: average value of the selected range in the colour space (default: [0, 0, 0])

Future additions:

  • Differentiating the center line
  • Hotswap colour space
  • Converting GUI to QT

line-segment-detector's People

Contributors

luncf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

line-segment-detector's Issues

raw_image.data

i got some problem like this
VIDEOIO ERROR: V4L: index 0 is not correct!
Traceback (most recent call last):
File "line-segment-detector/src/vision.py", line 103, in
if raw_image.data:
AttributeError: 'NoneType' object has no attribute 'data'

do you know how to solve it?

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.