Near-infrared analysis for in-line testing of capsules for the pharmaceutical industry