Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 34 commits ahead, 26 commits behind bhuman:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

SPQR Ball Perceptor


⚠️ This code is not the full SPQR Team Release but it is only a part of it released for the RoboCup Community. Please refer to the SPQR Team Description Paper for the details about all the modules contained in the SPQR Team release.

SPQR Ball Perceptor is provided WITHOUT ANY WARRANTY about its usability. It is for educational purposes and should be regarded as such. Please report bugs at


SPQR Ball Perceptor is a software module for black and white ball detection developed by the SPQR Team to be used within the BHuman framework. This repo is a fork from the official 2016 B-Human code release.

SPQR Ball Perceptor is distributed under the LGPL-3.0 license for the parts developed by the SPQR Team. This license does not apply to the parts of this distribution developed by others where the rights of the copyright owners remain. In particular, see the file "License.txt" for more details about the parts that have not been developed by the SPQR Team.

The details about the SPQR Ball Perceptor can be found in the technical report:
Domenico Bloisi, Francesco Del Duchetto, Tiziano Manoni, and Vincenzo Suriani "Machine Learning for Realistic Ball Detection in RoboCup SPL" arXiv:1707.03628 [PDF] [arXiv]

A Supervised Approach

The SPQR Ball detector is based on a supervised approach implemented in OpenCV. In particular, an LBP binary cascade classifier has been trained to detect the ball. Details about how to generate the classifier are available in the tutorial "How to Use OpenCV for Ball Detection - RoboCup SPL Use Case".


The SPQR Ball Perceptor has been tested on Ubuntu 16.04 LTS. The installation procedure is as follows.

  1. Install dependencies:
  • cmake
  • libgtk2.0-dev
  • pkg-config
  • libavcodec-dev
  • libavformat-dev
  • libswscale-dev
  • libjpeg8
  • libjpeg-turbo8-dbg
  • lib32z1-dev
  • libjpeg-turbo8-dev

To install the above dependencies on Ubuntu 16.04 use the following command: sudo apt−get install cmake libgtk2.0−dev pkg−config libavcodec−dev libavformat−dev libswscale−dev libjpeg8 libjpeg-turbo8−dbg lib32z1−dev libjpeg−turbo8−dev

  1. Install Opencv 2.4

  2. By following the B-Human code release documentation it is possible to conclude the code installation.

IMPORTANT: To improve the detection and to not discard far away balls it is necessary to calibrate the NAO's camera matrix and joints.


SPQR Ball Perceptor has been used by the SPQR Team during the competitions of the Robocup German Open 2017.

SPQR Ball Perceptor

SPQR Ball Perceptor can be used both indoor and outdoor without any modification.

SPQR Ball Perceptor indoor and outdoor

SPQR Team 2017

Daniele Nardi
Luca Iocchi

Team Manager
Domenico Bloisi

Software Development Leader
Vincenzo Suriani

Emanuele Antonioni
Matteo Cecchini
Francesco Del Duchetto
Tiziano Manoni
Armando Nania
Marco Paolelli


Supervised ball detection within the official B-Human code release 2016







No packages published


  • C++ 54.5%
  • C 28.6%
  • HTML 9.6%
  • Objective-C 2.2%
  • Shell 1.7%
  • Python 1.6%
  • Other 1.8%