Lego Brick Finder with OpenMV and Edge Impulse | DigiKey
In this tutorial, Shawn shows you how OpenMV and Edge Impulse can be used to create Lego® brick finder. Searching through a pile of Lego bricks to locate a particular piece can be a time-consuming task when you are constructing your Lego design (lovingly known as My Own Creation, or MOC). To alleviate that arduous task, we present you with the Lego brick finder! In the video, we snap lots of still photos using the OpenMV camera module and crop out small sections of each image. We train a neural network using Edge Impulse to classify these sub-image chunks as either containing our target piece or not. Then, we deploy the trained machine learning model to the OpenMV to locate our target Lego piece in each image it captures. Each time we snap a photo with the OpenMV, our program moves a sliding window across the whole image, computing the likelihood that each cropped section contains the target piece. If the likelihood is above our threshold, the part is highlighted on the LCD. Please note that this is a proof-of-concept demo project with many limitations. Namely, it is very slow, taking around 10 seconds to identify parts in each photo captured, has a limited field of view, and works with only 1 target piece at a particular distance with particular lighting. Scaling this to work with all Lego bricks would require more time, more data, a large database, and a faster processor for the user. Even though this is a fun demo showcasing machine learning on embedded systems, sub-image recognition and classification has many possible industrial applications. Such uses include self-driving cars, satellite image analysis, and X-ray image analysis. Code for this project can be found here: https://github.com/ShawnHymel/openmv-lego-brick-finder