A Pattern Matching Scheme for Accurate Medicine Localization in Automatic Pharmacy Inventory