This image processing device generates an operation image by adding or subtracting an original image and a standard deviation image which maps the standard deviation for the pixels configuring the original image. In this operation image, images of the structures seen in parts in the original image other than metal pieces are erased. Consequently, structures that are not metal pieces appearing in the original image in a whitish color, for example, do not appear in the operation image. If such an operation image is subjected to binarization processing in which the metal pieces appearing in a whitish color, for example, are extracted, since accurate graph cut processing is then possible, images originating from structures that are not metal pieces do not appear in the resulting image.