Cutting and stacking machine CCD detection system