Become a leader in the IoT community!

New DevHeads get a 320-point leaderboard boost when joining the DevHeads IoT Integration Community. In addition to learning and advising, active community leaders are rewarded with community recognition and free tech stuff. Start your Legendary Collaboration now!

Step 1 of 5

CREATE YOUR PROFILE *Required

Change Email
OR
Step 2 of 5

WHAT BRINGS YOU TO DEVHEADS? *Choose 1 or more

Collaboration & Work 🤝
Learn & Grow 📚
Contribute Experience & Expertise 🔧
Step 3 of 5

WHAT'S YOUR INTEREST OR EXPERTISE? *Choose 1 or more

Hardware & Design 💡
Embedded Software 💻
Edge Networking
Step 4 of 5

Personalize your profile

Step 5 of 5

Read & agree to our COMMUNITY RULES

  1. We want this server to be a welcoming space! Treat everyone with respect. Absolutely no harassment, witch hunting, sexism, racism, or hate speech will be tolerated.
  2. If you see something against the rules or something that makes you feel unsafe, let staff know by messaging @admin in the "support-tickets" tab in the Live DevChat menu.
  3. No age-restricted, obscene or NSFW content. This includes text, images, or links featuring nudity, sex, hard violence, or other graphically disturbing content.
  4. No spam. This includes DMing fellow members.
  5. You must be over the age of 18 years old to participate in our community.
  6. Our community uses Answer Overflow to index content on the web. By posting in this channel your messages will be indexed on the worldwide web to help others find answers.
  7. You agree to our Terms of Service (https://www.devheads.io/terms-of-service/) and Privacy Policy (https://www.devheads.io/privacy-policy)
By clicking "Finish", you have read and agreed to the our Terms of Service and Privacy Policy.

Getting Started Guide: Abandoned Object Detection

With OpenCV, Yocto Linux-based Clea OS, & SECO COM-HPC-A-RPL compute module

Table of Contents:

  1. Introduction
  2. Object Detection System Requirements
  3. SECO’s COM-HPC-A-RPL Module (Based on PICMG COM-HPC Client Size A specification)
  4. Yocto-based Clea OS from SECO and XFCE Desktop
  5. OpenCV & NumPy
  6. Configuration Details & How to Build Abandoned Object Detection System
  7. Key Takeaways
  8. Resources

1.   Introduction

Abandoned object detection is an important application for digital surveillance systems (DSS). Traditionally, this application was handled by powerful centralized computers, but modern AI systems can perform sophisticated object detection and tracking at the edge. To keep costs and development time down, these AI-powered DSS systems should use general-purpose, open-standard hardware and software wherever possible.

This guide demonstrates how to deploy abandoned object detection demo using the SECO COM-HPC-A-RPL, a computer-on-module (COM) solution based on the popular PICMG COM-HPC hardware standard. It employs an OpenCV layer within Clea OS, an optimized Yocto Linux distribution.

This guide highlights the key features of the COM-HPC-A-RPL and demonstrates how to combine it with a carrier board to create a complete system. It explains how to attach storage and an off-the-shelf camera. It then explains how to build an abandoned object detection pipeline.

2.   Object Detection System Requirements

Modern DSS systems consist of multiple interconnected subsystems that work together to provide real-time monitoring, threat detection, and incident response. These subsystems include data acquisition, AI-based analytics and threat detection systems, and a flexible software architecture that enables both local and remote users to monitor and respond to alerts.

Here we focus on the requirements of the compute platform and AI software.

This subsystem needs to meet three key requirements:

  1. Rapid, cost-effective development to be competitive in an already-crowded market.
  2. Flexibility to adapt to rapidly-evolving AI technology and the specialized needs of different markets.
  3. Scalability to take on applications with anywhere from a single camera to dozens of cameras without major hardware revisions

3.  SECO’s COM-HPC-A-RPL Module

The SECO COM-HPC-A-RPL is a PICMG COM-HPC Client module. It features the 13th Gen Intel Core processor and includes the memory, graphics, connectivity, and AI acceleration needed to run robust computer vision (CV) applications.

[Source: https://www.seco.com/Datasheet/Modules/COM-HPC/SOM-COM-HPC-A-RPL.pdf]

PICMG is an international consortium of hardware vendors. It maintains a wide selection of interoperable standards for everything from low-power, compact designs to high-performance, server-class systems. The PICMG COM-HPC standard is particularly well-suited to DSS designs, as it supports:

  • High-performance processors that can process multiple video streams
  • High-bandwidth I/O that can high-definition video, such as multiple USB 4.0 ports
  • Up to 64 GB of on-board memory

With the COM-HPC standard, the core systems elements such as the processor and memory are pre-integrated on a standardize compute module. This module is then plugged into an application-specific carrier board that contains systems peripherals.

This modular approach promotes flexibility and scalability. Design variants can be created for various markets by changing the carrier board design while leaving the compute module untouched. Similarly, a design can scale to different levels of compute power by simply swapping out the compute module.

COM-HPC modules may host a variety of computer architectures, including CPUs, GPUs, FPGAs, and AI accelerators. While each approach has its advantages, specialized computing hardware tends to lock designs into a single supplier and a closed software ecosystem. In contrast, CPU-based solutions are more flexible and easier to use with open-source software, supporting rapid, cost-effective development.

4.   Yocto-based Clea OS and XFCE Desktop

Alongside the impressive hardware foundation, the key advantage of the SECO COM-HPC-A-RPL in DSS applications comes largely from the flexibility of its Yocto-based SECO Clea OS. Like other Yocto embedded Linux distributions, the Clea OS can be readily modified to meet the unique requirements of specific applications.

In the case of the abandoned object detection demo covered in this guide, scripts are provided to configure and build the demo from a Google repo tool system. This will download all the required layers and set the local configuration files for the system.

Note that a new layer called meta-devheads was created for this demo. This layer contains an image definition that extended the Clea OS to add in the XFCE graphical Desktop Environment along with the demo application.

Once the system image has been built, it can then be copied to a USB drive and used to boot and install the system. Below is the BitBaker (bb) image recipe abandoned-image.bb.

SUMMARY = "Abandoned Image Detector Demo Image"
# Bring in the SECO Clea OS
require ../layers/meta-seco/meta-seco-clea-os-embedded/recipes-core/images/seco-image-clea-os-full.bb
# Bring in a graphical environment
IMAGE_FEATURES += "package-management x11-base x11-sato"
# Bring in the X11 display server and XFCE Desktop
IMAGE_INSTALL += "\
    packagegroup-core-x11 \
    packagegroup-xfce-base \
"
CORE_IMAGE_EXTRA_INSTALL += "\
    abandoned \
    opkg \
"
export IMAGE_BASENAME = "abandoned-image"

5.   OpenCV and NumPy

OpenCV is exactly what the name says: an Open Source Computer Vision Library. Ths demo described in this guide uses OpenCV along with NumPy, an open-source Python library for scientific computing. Together, these libraries enable rapid development of AI pipelines.

To further speed development, the demo uses an existing Abandoned Object Detection Project. Below is the BitBake recipe abandoned.bb that installs these components.

SUMMARY = "Abandoned Object Demo"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
LICENSE = "CLOSED"
# Install NumPy and OpenCV by making them a
# run-time dependency of the demo application
RDEPENDS:${PN} += "\
    python3-numpy \
    python3-opencv \
"
SRC_URI = "git://github.com/ming4real/Camera_Demos.git;branch=main;protocol=https"
SRCREV = "ab7b4442fabf2bca72615af241a55d4f7aa7e4c0"
S = "${WORKDIR}/git"
# Install Abandoned Object Detection Project
do_install() {
    install -d ${D}/usr/local/bin
    install -m 0755 ${S}/OpenCV/Python/Abandoned_Object/Abandoned_object_detection.py ${D}/usr/local/bin/abandoned_object_detection.py
    install -m 0755 ${S}/OpenCV/Python/Abandoned_Object/tracker.py ${D}/usr/local/bin/tracker.py
}
FILES:${PN} += " \
/usr/local/bin/abandoned_object_detection.py \
/usr/local/bin/tracker.py \
"

6.   Configuration Details

To configure OpenCV, an append file opencv_%.bbappend was created with the line

PACKAGECONFIG:append:pn-opencv = " gstreamer freetype dnn v4l gtk"

Also, the libbytesize recipe had an out of date reference to the branch in GitHub, so this was overwritten with the file libbytesize_2.6.bbappend that contained the line

SRC_URI = "git://github.com/rhinstaller/libbytesize;branch=main;protocol=https"

To test video input on the system, a USB Webcam was plugged in. To ensure that the camera was seen, run the command

gst-launch-1.0 camerabin

This will use the GStreamer framework to display the videostream from the camera.

Next, to check that OpenCV can read and display the video stream, run the following script:

#!/usr/bin/env python3
import sys
import cv2
# Set Width and Height of output Screen
frameWidth = 640
frameHeight = 480
# Use the first available camera
camera_id = 0
cap = cv2.VideoCapture(camera_id)
cap.set(3, frameWidth)
cap.set(4, frameHeight)
if (cap.isOpened()== False):
    print("Error opening video source")
    sys.exit(1)
# Read until video is stopped
while(cap.isOpened()):
# Capture frame-by-frame
    ret, frame = cap.read()
    if ret == True:
    # Display the resulting frame
        cv2.imshow('Frame', frame)
    # Press Q on keyboard to exit
        if cv2.waitKey(25) & 0xFF == ord('q'):
            break
# Break the loop
    else:
        break
# When everything done, release
# the video capture object
cap.release()
# Closes all the frames
cv2.destroyAllWindows()

Having proved the camera and OpenCV, it is then possible to run the demo.

7.   Key Takeaways

The combination of the SECO COM-HPC-A-RPL and Clea OS makes for a DSS system starting point that is easy and flexible to work with.

The hardware advantages include:

  • Standards-based (PICMG COM-HPC)
  • Modular, can be replaced or extended based on the requirements of the application
  • Retain interoperability with the ecosystem of interoperable COM-HPC board from multiple vendors

The software advantages include:

  • Free, open source, and customizable Yocto Embedded Linux Operating System
  • Built from the ground up for edge AI and connected IoT deployments that generate large volumes of data for local and cloud processing,
  • Maintained by leading edge computing company SECO

Development experience with the SECO hardware and software stack for DSS developers is extremely straightforward, requiring only a few commands from a terminal application before you can begin modifying layers of the Clea OS.

As shown, you can easily incorporate other open-source software modules and libraries such as OpenCV, the latest off-the-shelf AI models, and more.

And thanks to the COM-HPC standard, developers can build free of fear from being locked into a single vendor or supply chain disruptions that can jeopardize their entire design or project.

8.   Resources

SECO COM-HPC-A-RPL:

SECO Clea OS:

OpenCV stack:

For more information, visit the DevHeads IoT Integration community at https://devheads.io

CONTRIBUTE TO THIS THREAD

Browse other questions tagged