Fabian Weller

Technology Developer

Capture the Cube Logo

Capture The Cube

Programming Languages: Python
Design Pattern: Observer Design Pattern
Communication Protocols: WebSocket, UART
Development Tools: Pip, OpenCV, Nano, Nmap, PlatformIO
Operating System: Kali Linux, Raspi OS Server

Capture the Cube is a computer vision project I developed entirely from scratch during my training. I am deeply honored that my school entrusted me with this project, designed to help future apprentices explore and learn about computer vision technology. It was specifically created to provide apprentices with hands-on experience using cutting-edge technology and to develop their skills in a practical setting. The "Capture the Cube" project is an educational initiative aimed at teaching students the fundamentals of computer vision and robotics. The project involves developing and programming a four-wheel drive robot, known as the waveshare raspRover, equipped with a Raspberry Pi and a camera.


The procedures described here have a clear focus on ease of implementation, flexibility, and error avoidance. To ensure a modular structure of the project, I chose the Observer Design Pattern. In this case, a “WebSocket” acts as the subject, and a collection of Python scripts as the observers. To the best of my current knowledge, this seemed to be the most sensible solution to meet all the project’s requirements. It offers the necessary speed as well as a very flexible and clearly separable structure for all functions and components. By using a WebSocket, the project can be easily scaled. With minor changes, the observer scripts can be easily migrated to other systems to, for example, implement a database or the API of a language model.

Project Objectives

The main goal of this project is to implement and optimize algorithms for detecting and tracking colored objects (cubes) using Python and OpenCV. Students will learn to:

  • Set up a development environment on a Linux-based system.
  • Integrate various hardware components such as cameras, motors, and microcontrollers.
  • Develop and refine computer vision algorithms for object detection and tracking.
  • Apply real-time data processing and communication protocols using WebSockets.

Hardware Components

Hardware Components

The project utilizes a range of hardware components to build the robot, including:

  • Raspberry Pi 4: Acts as the central processing unit for running computer vision algorithms.
  • ESP32 Motor Driver Board: Controls the motors to navigate the robot.
  • Camera: Captures live video feed for processing by the computer vision algorithms.
  • Motors and Chassis: Provides mobility and stability to the robot.
  • Battery: Powers the robot and all connected components.

Software Components

Software Components

The software architecture of the project is designed using the Observer Design Pattern. Key software components include:

  • Python and OpenCV: For developing computer vision algorithms.
  • WebSocket API: For real-time communication between the robot and the control interface.
  • ESP32 Firmware: For motor control and executing movement commands.
  • Linux Development Tools: For setting up the development environment and managing project dependencies.

Project Workflow

The project workflow involves several stages:

  1. Initial Setup: Configure the Raspberry Pi and install necessary libraries and tools.
  2. Hardware Integration: Connect and configure the camera, motors, and other components.
  3. Algorithm Development: Write and test computer vision algorithms to detect and track objects.
  4. Real-time Communication: Implement WebSocket communication for real-time data transfer.
  5. Testing and Optimization: Test the robot's performance and optimize the algorithms for better accuracy and efficiency.

The documentation is primarily intended for teachers and can be used by students if they need assistance. To ensure that students develop their own solutions and do not find all the answers on my website, I cannot upload the full documentation. However, if you are interested in the complete documentation, I would be happy to send it to you via email upon request.