High speed M&M sorting machine
That's low-speed sorting.  <i>This</i> is high-speed sorting:<p><a href="https://www.youtube.com/watch?v=DogZJmThRSE" rel="nofollow">https://www.youtube.com/watch?v=DogZJmThRSE</a><p>That's a high-speed computer-vision optical pea sorter.  Yes, each and every pea in that huge flow of peas is examined by a computer vision system.  Tiny high-speed air jets are kicking out the rejects during the brief period the peas are in free flight.<p>Here's a blueberry sorting machine, throwing out anything that doesn't look like a round blue blueberry:<p><a href="https://www.youtube.com/watch?v=8CyWvnh4YtE" rel="nofollow">https://www.youtube.com/watch?v=8CyWvnh4YtE</a><p>That machine could sort M&Ms by color, easily.<p>The food industry has lots of machines like that. The technology was first applied to large fruit like tomatoes. It's now so cheap it's applied to rice and grains.