OpenCV Running On A Tiny Microcontroller

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!

10 thoughts on “OpenCV Running On A Tiny Microcontroller

  1. 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.

    1. So,
      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.
      B^)

  2. 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.

  3. 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.

  4. well i am wanting to make a setup using OpenCV for positioning and obstacle avoidance for a drone, the problem is, the drone is really small, and suggestions

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.