Skip to content

transcend-information/RaspberryPi_ObjectDetection_Demo

Repository files navigation

Transcend ECM300 Raspberry Pi 5 Object Detection Demo

This project demonstrates real-time Object Detection on the Raspberry Pi 5 platform, using the Transcend ECM300 embedded camera module.


Table of Contents


Hardware Requirements

  1. Supported Platforms

    • Raspberry Pi 5
  2. Supported Cameras

  3. Recommended SD Card

    • A microSD card with at least 128 GB capacity and UHS-1 speed class or higher.

Install Raspberry Pi 5 OS

Important: The ECM300 camera driver is only compatible with Raspberry Pi OS running Linux kernel version 6.12.25+rpt-rpi-2712. Using a different kernel version will result in driver incompatibility.

Installation Steps

  1. Download Raspberry Pi OS (64-bit, Debian Bookworm) dated 2025-05-13 from https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2025-05-13/2025-05-13-raspios-bookworm-arm64.img.xz

    Note: This specific OS version includes the required kernel 6.12.25+rpt-rpi-2712.

  2. Write the image to the microSD card using Raspberry Pi Imager.

    • In the "Choose operating system" step, select "Use custom" at the bottom of the list, then choose the downloaded image file.
  3. Insert the microSD card into the Raspberry Pi 5 and complete the initial setup (language, username, WiFi, etc.).

  4. Important: During the OS installation process, when prompted with "Update Software" dialog:

    • Click "Skip" to continue without checking for updates

    • DO NOT click "Next" as this will update the system and may upgrade the kernel to an incompatible version

  5. After first boot, verify the kernel version:

    uname -r

    Expected output:

    6.12.25+rpt-rpi-2712
    

    Warning: If the kernel version does not match exactly, do NOT proceed with driver installation. The camera driver will not work with other kernel versions.

  6. Do NOT run system updates after installation, as this may upgrade the kernel to an incompatible version:

    # DO NOT RUN THIS
    # sudo apt update && sudo apt upgrade

    The installation script will automatically lock the kernel version to prevent accidental updates.


Connect the ECM300 Camera to Raspberry Pi 5

  1. Power off the Raspberry Pi 5 completely:

    sudo shutdown -h now
  2. Insert the camera module as follows:

    • ECM300: Insert into the CAM/DISP 1 port (the port closer to the USB-C power connector)
  3. Power on the Raspberry Pi 5.


Install IMX675 Camera Driver

1. Prepare Driver Package

Copy the Driver_Install folder to the desktop:

cd ~/Desktop/RaspberryPi_ObjectDetection_Demo/Driver_Install

2. Installation

Note: Please make sure the device is connected to the Internet before starting the installation.

Option A: Automatic Installation (Recommended)

Execute the installation script:

chmod +x install_imx675.sh
./install_imx675.sh

The installation will:

  • Install build dependencies (meson, ninja, kernel headers, etc.)
  • Clone and compile libcamera with IMX675 support
  • Install kernel module and device tree overlay
  • Configure system settings
  • Lock kernel version to prevent incompatible updates

Installation time: Approximately 15-25 minutes depending on your SD card speed and internet connection.

Option B: Manual Installation

Refer to the manual located in:

Driver_Install/CameraDriver_Package_v1.0/docs/

Follow the step-by-step instructions in the manual for manual installation.

3. Reboot

After installation completes successfully, reboot the system:

sudo reboot

4. Verify Installation

After reboot, verify the camera driver is working:

# List available cameras
libcamera-hello --list

# Test camera preview for 5 seconds
libcamera-vid -t 5000

Expected output:

Available cameras
-----------------
0 : imx675 [2592x1944 10-bit RGGB] (/base/axi/pcie@120000/rp1/i2c@80000/imx675@1a)

Note: The camera will only appear in the list after you physically connect it in the next section.


Quickly Run Object Detection

1. Run the Script

On first run, the script will automatically create a virtual environment (.venv) and install required packages. This may take a few minutes.

cd ~/Desktop/RaspberryPi_ObjectDetection_Demo
chmod +x run_object_detection_raspi.sh
./run_object_detection_raspi.sh

2. Choose the Detection Classes

When prompted, select the desired object classes, or enter 'd' to use the default list (Person, Glasses, Tie, Monitor/TV).

Example: If you want to detect Person, Glasses, Tie, and Monitor/TV, enter: 233,136,325,201

Press 'q' to exit the application.


Run Object Detection Manual

1. Set Up Virtual Environment

Navigate to the project directory and activate the virtual environment:

cd ~/Desktop/RaspberryPi_Object_Detection_Demo
source .venv/bin/activate

Note: If the virtual environment doesn't exist (or you see bash: .venv/bin/activate: No such file or directory),

Run the following commands to create it and install the required packages:

python3 -m venv .venv --system-site-packages
source .venv/bin/activate
pip install -r requirements.txt

2. Run the YOLO Detection Script

python webcam_yolo_raspi.py

The program will:

  • Automatically start libcamera-vid in the background
  • Stream frames via pipe to the YOLO detection engine
  • Display real-time detection results

Press 'q' to exit fullscreen mode.

3. Deactivate Virtual Environment

To deactivate the virtual environment:

deactivate

Third-Party Licenses

This project uses NRtred/yolo11n_object365, which is licensed under the MIT License. All third-party license details are stored in the Third-Party Licenses/ directory for reference.

About

A Object Detection demo application using Transcend ECM300 Camera in Raspberry Pi.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors