Specifically, the first characteristic value C1 is represented by a value of 0 to 359 degrees with respect to a predetermined direction (x direction in FIG. 3, for example) of the gradient vector K. When the image is a human face as illustrated in FIG. 4A, in a dark area such as eyes and a mouth, the gradient vectors K calculated as described above are directed to the center of each of the eyes an