Non-destructive measurement of apple internal quality by using near-infrared spectroscopy