OpenMV: Low-cost, open-source platform enables disparate embedded vision applications
Making embedded machine vision applications more accessible is the ultimate goal of OpenMV, a project responsible for developing multiple iterations of open-source, low-cost embedded camera platforms.
OpenMV began in 2013, when Ibrahim Abdelkader, Vice President and Co-Founder, sought a better, cheap serial camera module than what was available to him. The desired result was a small, expandable machine vision module that cost less than $100. Eventually, OpenMV moved to a Hackaday Project, then to a Kickstarter project, then—when Kwabena Agyeman, President and Co-Founder joined in 2015—an operating business.
Since then, OpenMV developed and sold multiple iterations of the camera platform. The current iteration of the OpenMV Cam, the H7, features an STMicroelectronics STM32H743VI ARM Cortex M7 processor running at 400 MHz with 1 MB of RAM and 2 MB of flash. All I/O pins output 3.3V and are 5V tolerant. I/O interfaces include a USB computer interface; a μSD Card socket capable of 100 Mbps reads/writes; an SPI bus that can run up to 100 Mbps, an I2C bus, CAN bus, and an asynchronous serial bus for interfacing with other microcontrollers and sensors, as well as 12-bit ADC, 12-bit DAC, three I/O pins for servo control, RGB LED, and two 850 nm infrared LEDs.
Tracking of up to 16 colors at a time is possible with the OpenMV Cam H7.
A removable camera module allows the OpenMV Cam H7 to interface with different sensors, but the camera comes with an OV7725 image sensor from OmniVision Technologies. This 640 x 480 color sensor is a 1/4” CMOS image sensor running at 60 fps at full resolution, and higher speeds of up to 120 fps with a resolution below 320 x 240. Additionally, the camera has a 2.8 mm lens on a standard M12 lens mount.
For professional machine vision applications, OpenMV offers a global shutter camera module consisting of the 752 x 480 MT9V034 global shutter CMOS sensor from ON Semiconductor. For thermal imaging applications, OpenMV offers a FLIR Lepton adapter module.
“Deploying thermal capabilities with our system is a simple process,” say Agyeman. “Let’s say you want to put a camera in the corner of a room for security or surveillance. Maybe it has a Wi-Fi chip on board that will send out a message to the server whenever it sees anything. OpenMV cam is that all-in-one package that does everything.”
He continues, “We have a battery connector, a Wi-Fi shield, FLIR Lepton support, and the software is all there to have the whole system turn on, capture a thermal image, and turn off, while surviving on very-lower power, waiting on some environmental action to happen.”
Concerning software, programming is done through MicroPython—a version of the Python programmable language, written in C, optimized to run on a microcontroller. OpenMV’s camera has a MicroPython kernel running on board.
“With the kernel, you can send a script of Python code, and it parses, compiles, and executes that code. All our functions are written in C, then they have a Python module created for them that you can call using the MicroPython interpreter. The reason having Python is helpful is that our firmware is about 2 MB now, and it takes a good minute or so to load the firmware,” he says.
“If you were working in C,” Agyeman continues, “it would take that long to program the device every single time, including any time a single change is made. Efforts could be made to have some parts of the firmware reprogrammable and some parts not reprogrammable, avoiding the need to erase the whole thing, but by instead using MicroPython, we have a less-than-one second compile, upload, and execute time.”
OpenMV’s latest camera, the OpenMV Cam H7, is built on an ARM Cortex M7 processor.
Real-world examples and capabilities
All versions of the OpenMV cam can accomplish various imaging tasks, including color tracking, face detection, video recording, and fiducial marker tracking (AprilTag marker tracking), says Agyeman, but one potentially intriguing feature for the machine vision community is character recognition, which is accomplished using the Chars74K image dataset. Comprised of a massive number of pictures of the letters A-Z and the numbers 0-9, this dataset enables the identification of printed characters with theH7.
While it doesn’t necessarily have “full text recognition,” the OpenMV Cam H7 can be pointed at a letter and recognize that letter, says Agyeman.
“When targeting the region of interest of an image, the algorithm runs at about 20 fps. If you don’t need a high frame rate, you can take a picture, and if you know where the digits are supposed to be in that image, you can launch the algorithm on the area and digitize that text,” he says.
An example provided by Agyeman has OpenMV cam pointed at a mechanical dial with rotating digits, with a goal of digitizing the dial with the aid of machine learning.
“Even with OpenCV and a Linux-based processor, it isn’t easy,” he says. “Solving this is only possible with template matching or with machine learning. With the H7, however, we have a machine learning example script built right into the camera, with no software install required. You have gas in your car and you’re ready to build your application without spending hours trying to figure out how to set up an environment and do training.”
Additional real-life applications in which OpenMV’s cameras have been deployed include robotics competitions such as FIRST Robotics (Manchester, NH, USA; www.firstinspires.org), as well as on product line assembly applications for simple feature detection. Free features built into the camera include barcode reading, QR code reading, and data matrix reading capabilities. While the H7 camera or previous versions of the camera cannot match the capabilities of industrial cameras or smart cameras, typically used in machine vision, one advantage held by OpenMV and its cameras is cost.
“People use OpenMV cameras when they do not want to pay for the cost of a complicated machine vision camera system, and they are looking to accomplish something involving a minimal quality control check and want a simple solution that can be implemented quickly,” says Agyeman. “This saves them from using a systems integrator and expensive cameras and PCs.
Using an OpenMV camera as a microcontroller—plugging it into a computer writing simple code, and using the editor to take care of installation—is another application seen by Agyeman as of late.
Looking forward, the OpenMV team has its sights on developing new artificial intelligence (AI) solutions.
“One thing we can do, because it is a processor, is directly use the SPI BUS interface to talk to other processors. Different AI boards now exist that help accelerate and enable new applications. We are thinking of integrating these as shields for future cameras,” he says.
“Furthermore,” he says, “We are working on integrating artificial intelligence functionalities into the camera.”