← Back to the main page

Sub-Project 1: Lego Detection

In sub-project 1, each group must create a system for live detection of Lego bricks using Raspberry Pi and a camera. The system must be abke to:

Additionally, you are required to (1) flash the latest version of Raspberry Pi OS (64-bit) onto the SD card, and (2) that you must build OpenCV from source for the Raspberry Pi.

Hints for sub-project 1

  1. For the camera to work you will need to make the following changes in /boot/config.txt: comment out or remove the line camera_auto_detect=1 and add gpu_mem=128 and start_x=1.
  2. Flash images and instructions for flashing the OS are available on the official Raspberry Pi webpage.
  3. Except for OpenCV, you may install any necessary programs or libraries using e.g. sudo apt-get install ...
  4. Fetch the source code for OpenCV.
  5. Find, and try to follow, instructions for building OpenCV from source. In case you face an error saying that something is missing (g++, make, cmake, ???), install it and retry.
  6. If the build is successful (which may take quite long!), your next problem is to make sure that Python finds your newly built cv2-module.. There are various ways to solve this, depending on the approach you take!