UPDATE:
I added a video of the 'finished product' that I presented in front of the class. It basically combines everything that I've talked about previously into one algorigthm for 'sorting'. I also uploaded two flow charts as attached files which outline the steps of each program. It's a bit of a proof of concept rather than something helpful but I'm still pretty happy with it.
Hi.
Imgur photos here: http://imgur.com/a/AZg0n#0
At the end of grade 12 I had a control systems assignment and as my project I decided to make a Lego sorter. The idea is to eventually get every piece that my school owns to be sorted and it be completely independent, but we only had about 12-15 hours of school time over 4-5 weeks to do it so that was a bit of a stretch.
I used SimpleCV for the recognition. (If you've not heard of it then it's a python library which uses the OpenCV libraries but makes them a bit easier to use). Basically, there is a saving program in which I put the Lego piece on the white plate in every orientation that it is likely to fall on. The program saves pictures for each of these orientations in a directory with the name of the piece. (I have no idea if this is the best way to do machine learning pictures but it seems to work alright, any suggestions are welcome)
The machine learning program then comes along and learns based on the pictures (it uses the SVM machine learning method from SimpleCV, which uses the Orange libraries).
Finally there is the actual robot which is a python to NXT interface achieved through a USB serial link and the nxt-python library. There is an initial setup sequence which checks the camera and the nxt and then it starts sorting. The conveyor moves the piece onto the white plate, the camera classifies it using the machine learning, then the last motor turns around to put the piece in its own bay (which are still under construction). --I am still working on this last part of the program and I have only done the setup sequence as of now--
Once this first phase is all done I will probably start work on a feature extractor made just for the lego which will hopefully improve accuracy.
It has been great fun so far and I hope to do a bit more with SimpleCV and a RPi over the school holidays.
Thanks for reading,
-Riddellikins
Sorts lego into their singular piece types
This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/lego-sorter