1. load packet contents on transparent substrate 2. short vibration to randomly disperse 3. image capture top and bottom 4. ML processing 5. dispose of load 6. goto step (1)
Cameras for this class of application are cheap, but if 1 camera is an explicit design requirement, then a simple motor with 90-degree camera mount to capture top, rotate 180-deg, capture bottom is simple enough as well (albeit less reliable given the introduction of a precision electromotive element to the system).
If alignment is critical, then error budget can be appreciably extended by marking corners of transparent rectangular platter with distinct color/shape on top and bottom to serve as fiducials in computer-aided skew correction/alignment, compensating for inevitable drift over time; it could also supplement human validation of archived images so orientation is easily determined.
So you're saying a machine and multiple cameras?
Wouldn't really consider a discrete vibrator afixed to a solid platter a "machine" per se, but if you want to call it that, sure. I gave the problem 10 sec of back-of-the-envelope thought. 10 sec more suggests you can skip vibrator integration by selecting a more rigid transparent substrate, e.g. glass...Skittles would naturally rattle on that as a package is loaded. 10 sec more suggests you can constrain camera movement even further by using carefully oriented mirrors. How far down the rabbit hole would you like to go?
Why? There is zero need for this. I know it's one of the buzzwords of the recent years, but identifying colors? Come on.
Keeping with the context of the GP's remark, a solution is more about achieving process speed while minimizing error and human intervention in the face of uncertainty--i.e. single-shot at the package level, which is at least a 50x speed increase over individual mechanical sorting.