Provided are a drug recognizing apparatus, a drug recognizing method, and a drug recognizing program capable of enhancing robustness of a master image in a case where a drug is recognized. The drug recognizing apparatus includes an illumination unit that illuminates a drug; an imaging unit that images the illuminated drug; a storage unit that stores a master image for each drug type; a drug position acquiring unit that acquires a position of the drug on the basis of a captured image obtained by the imaging unit; a master image generating unit that generates the master image from a drug area in the captured image; an updating determination unit that determines whether to update the master image on the basis of the position of the drug acquired by the drug position acquiring unit; and a registration unit that registers the master image in the storage unit in a case where it is determined that the master image is to be updated.