A DIY M&Ms and Skittles sorting machine
Here's the commercial version.[1] This machine is sorting peas by color. Peas. Individual peas. Each individual pea is examined by cameras for size, color, and looking like a pea.  Rejects are kicked into the reject hopper by an air jet. There are machines like this for most fruit.  Typical throughput is a ton per hour.  Most fruit and berries go through such machines today.  That's why the fruit at the supermarket is so consistent.The process looks like magic.  Color-mixed items go in, and single-color items come out, on a line going so fast that no human can see what's happening.  It's amazing to see computer vision systems that fast.These machines work by putting the items on a conveyor belt, then dropping them on a much faster conveyor to spread them out. The fast conveyor goes past cameras, and at the end, launches the items into free flight for a few inches.  While in flight, computer-controlled air jets knock out the rejects.[1] https://www.youtube.com/watch?v=JyGR6A5MWG0