Non-invasive optical quality control in packaging production