Pill-detection method for pill box

PURPOSE: A method for detecting pills inside a medicine box is provided to improve the performance and the speed for detecting pills inside the medicine box, thereby accurately certifying that a medicine is a compounded original medicine. CONSTITUTION: A method for detecting pills inside a medicine box is as follows. A pill image detection system photographs loaded medicines under the transparent bottom surface of the medicine box with a camera (S100). An image information extractor of the system translates the obtained images into binary code and removes edges of the images (S200). An image analysis unit of the system applies circular filters of different sizes to the binary code images in stages, thereby detecting images of the pills (S300). [Reference numerals] (AA) Start; (BB) Finish; (S100) Obtain images by photographing loaded medicines; (S200) Translate the obtained images into binary code and extract binary images by removing edges of the images; (S310) Generate a first image by applying a circular filter algorithm of a size of 40 X 40 to the binary images; (S320) Generate an exclusive image by XOR calculating the first image and the binary images; (S330) Generate a second image by applying a circular filter algorithm of a size of 12 X 12 to the exclusive image; (S340) Generate a third image by applying a circular filter algorithm of a size of 28 X 28 to the binary images; (S350) Detect images of pills by OR calculating the second and third images