Become a leader in the IoT community!
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
How to build an intelligent vision system with SECO’s Intel processor-based COM-HPC-A-RPL COM-HPC module, the Yocto-based Clea operating system, and OpenCV.
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.
It will highlight the key features of the COM-HPC-A-RPL and demonstrate 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.
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:
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.
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:
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.
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 BitBake (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 environmentIMAGE_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"
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 \
"
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.
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:
The software advantages include:
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.
Browse other Product Reviews tagged
CONTRIBUTE TO THIS THREAD