An image processing device, comprising: a master image obtaining unit configured to obtain a master image of a medicine to be dispensed based on prescription information; a taken image obtaining unit configured to obtain a plurality of taken images of a dispensed medicine, with emitting directions of light to a surface of the medicine different from each other; a first image processing unit configured to perform a process of obtaining an engraved mark portion of the medicine by photometric stereo, based on at least one taken image among the taken images, and generate a first enhanced image as contour extraction image representing heights as image luminance; a second image processing unit configured to perform a process of enhancing a printed character portion of the medicine, based on the at least one taken image among the taken images, and generate a second enhanced image by at least one of a smoothing process, a sharpening process and an edge detecting process; an image integrating unit configured to integrate the first enhanced image and the second enhanced image with each other, and generate an integrated image, wherein the image integrating unit is configured to compare luminance values of the first enhanced image and the second enhanced image generated from a same taken image at corresponding positions with each other and adopt the luminance values being relatively higher to generate the integrated image; and a determining unit configured to collate the generated integrated image with the master image, and determine whether the medicine to be dispensed is identical to the dispensed medicine or not. a master image obtaining unit configured to obtain a master image of a medicine to be dispensed based on prescription information; a taken image obtaining unit configured to obtain a plurality of taken images of a dispensed medicine, with emitting directions of light to a surface of the medicine different from each other; a first image processing unit configured to perform a process of obtaining an engraved mark portion of the medicine by photometric stereo, based on at least one taken image among the taken images, and generate a first enhanced image as contour extraction image representing heights as image luminance; a second image processing unit configured to perform a process of enhancing a printed character portion of the medicine, based on the at least one taken image among the taken images, and generate a second enhanced image by at least one of a smoothing process, a sharpening process and an edge detecting process; an image integrating unit configured to integrate the first enhanced image and the second enhanced image with each other, and generate an integrated image, wherein the image integrating unit is configured to compare luminance values of the first enhanced image and the second enhanced image generated from a same taken image at corresponding positions with each other and adopt the luminance values being relatively higher to generate the integrated image; and a determining unit configured to collate the generated integrated image with the master image, and determine whether the medicine to be dispensed is identical to the dispensed medicine or not.