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:
- Analyse streaming video from the camera.
- Detect and mark the centres of all red, green, yellow and blue Lego bricks in the video.
- Run in real-time Raspberry Pi.
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
- For the camera to work you will need to make the following changes in
/boot/config.txt
: comment out or remove the linecamera_auto_detect=1
and addgpu_mem=128
andstart_x=1
. - Flash images and instructions for flashing the OS are available on the official Raspberry Pi webpage.
- Except for OpenCV, you may install any necessary programs or libraries using e.g. sudo apt-get install ...
- Fetch the source code for OpenCV.
- 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.
- 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!