A method of inspecting a defect on a surface of a printed matter includes
a step of applying a gray scale erosion filter to a non-defect surface of
a printed matter to prepare a gray scale erosion filter applied image and
then adding a predetermined density value to the gray scale erosion
filter applied image, thereby preparing a reference image, a step of
subtracting a captured image of the surface of the printed matter to be
inspected from the reference image, thereby preparing a differential
image, and a step of applying a density compensation process to the
differential image to prepare a density compensated image, then applying
an edge detection filter to the density compensated image to prepare an
edge detection filter applied image and then converting the edge
detection filter applied image into binary data according to a
predetermined threshold value.