I have a rather large collection of LEGO elements that are not sorted in any way, and I'd like to keep track of them. There are a few other posts about ways to keep track of elements, and I've looked at them. I've downloaded about three different programs that are for LEGO inventory keeping, but I'm kind of picky.

I'd want something that I can input bricks into rather quickly, and though these programs are cool, I don't need to look up current prices or keep track of sets or whatever, as I have loads of loose pieces. Does anyone know anything that would meet those conditions? Even some sort of scanner build would be great.


1 Answer 1


As you have probably guessed by now, there is no easy solution to your question. It all comes down to computer vision.

In this solution, Akiyuki built a massive machine out of LEGO bricks, a camera, a scale, 2 Mindstorm NXT and, which he fails to mention in is parts list, a computer and some electronics.

enter image description here

Computer vision is complex, and making a working prototype is still an impressive task. Even though the software component of this project is most probably the reuse of an existing solution like OpenCV, there are many other problems to overcome. For example; Mechanically bringing the parts to the camera one by one in a controlled fashion. Also if the part is not laying down from a recognisable angle, you would probably have to flip it or take pictures with multiple cameras in order to get a good look at it.

Still, being a software developer myself, this is not the part that worries me. Even if you manage to build the whole machine, you still need to compare the pictures with a library of all the known LEGO bricks. Even more, they need to be imaged from all possible sides (when laying down). Building this knowledge base is a big endeavour on its own.

enter image description here

Here is a video of the working machine.

If you can reduce the complexity of parts to sort it can really help. Akiyuki has also made sorters for Technic beams and axles (both of which work on the same very simple principles).

If you do decide to build a brick sorter you probably would be better off designing one for the parts you use the most/have the most of and hand sorting the rest.

  • 1
    Thanks! I happen to follow Akiyuki on YouTube, but I had completely forgotten about this video of his. I'll look into making it...sometime...
    – rivermont
    Mar 12, 2015 at 13:56
  • 1
    Hmm - if you're willing to take the time though surely this is a prime candidate for machine learning as well: you train it with some known bricks first and let it build its understanding of different bricks from there ;) Mar 12, 2015 at 18:45
  • 1
    @Zhaph-BenDuguid that would be my first choice too. I would also cross that with a web brick database like BrickLink to automate linking new found shapes with existing brick names.
    – pcantin
    Mar 12, 2015 at 21:58
  • One could use parts files from the common brick CAD systems as models to fit to the camera images - that could help learn the brick shapes and make the task of creating the parts database easier.
    – Exilyth
    Feb 8, 2019 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.