At first blush, it might seem like projects that make extensive use of computer vision or machine learning would need to be based on powerful computing platforms with plenty of clock cycles and memory to handle this type of application. While there is some truth to this, as the field progresses it becomes possible to experiment with these tools on low-power devices as well. Take this OpenCV project which is built entirely on an ESP32 for example.
With that being said, there are some modifications that need to be made to the ESP32 in order to use OpenCV in any meaningful way. The most important of these is the use of the ESP32-DOWDQ6 module which increases the available memory of the ESP32 to allow it to make better use of camera functions. Even then, the ESP32 can’t run the entire OpenCV application, so a shrunken version of OpenCV is required before the device can run it natively. Once those two obstacles are out of the way, though, doing things like edge detection, as this project demonstrates, are well in the realm of possibility.
If running OpenCV on something as small as an ESP32 is possible, it is even easier to run on something orders of magnitude more powerful and yet still inexpensive, such as the Raspberry Pi. While the project’s code is available on its GitHub page for those interested, there are plenty of other OpenCV projects that we have featured on more powerful platforms as well, like this clock which falls off of the wall whenever someone looks at it.
Thanks to [ninjan33r] for the tip!
9 thoughts on “OpenCV Running On A Tiny Microcontroller”
On a side note, there is also OpenMV doing machine vision on small embedded boards. They have there own hardware, but there was talk of porting/supporting OpenMV on ESP32 (a few years ago, not sure if that happened).
Something excellent to read about is the viola-jones detector. Super-optimized for ultra-low-performance computers (micrcontrollers in the early 2000’s) yet it’s still the standard solution for pretty much all face detection. It’s even still commonly used as the first detection step for neural face-processing pipelines, since it’s much easier to implement than a neural face detector and performs about as well.
So yes, you can run computer vision applications on very constrained hardware. It’s a matter of very careful algorithm design.
has it actually detected a Viola Jones?
Or, it is still waiting for one to show up to be detected?
Oh, I’d better put a smiley here, so people won’t think I’m serious.
“”” > 99% accuracy on standard image sets
can run on an abicus. “””
Now the question is, if we were to use this shrunk down version of Open CV on a more capable platform, say a laptop, would it allow for very high speed results with many parallel instances running concurrently, to pool an array of different environment data and correlate it for better conclusions, with less overhead.
This is really cool!
If performing very basic features from OpenCV, why not just implement them from scratch – edge detection is fairly easily implemented without a library of course. Not trying to pooh-pooh this project, it’s cool, just saying it seems harder to shrink OCV onto this than to write from scratch.
Is this the same one? https://www.reddit.com/r/arduino/comments/urxt9p/running_opencv_on_esp32_standalone/
Please be kind and respectful to help make the comments section excellent. (Comment Policy)