An image processing apparatus sets respective pixel values of a template
block which includes a pixel to be determined for each pixel to be
determined set in sequence in an image, arranges a plurality of reference
blocks so as to surround the template block, obtains respective block
matching errors between the respective pixel values of the plurality of
reference blocks and the respective pixel values of the template block,
and determines that the pixel to be determined is in an edge area when a
smallest value from among the block matching errors is a deviated value
from all the block matching errors.