Automated visual inspection of glass bottles using adapted median filtering