Patent ID: 8897520

Claim:
An image processing apparatus, comprising: a processor; and a memory storing computer-readable instructions that, when executed by the processor, implement: an approximate value calculating unit that calculates approximate values for respective pixel values of pixels of an examination area so that the approximate values are continuous within the examination area, based on the pixel values of the pixels of the examination area in an image; a validity evaluating unit that evaluates whether the approximate values are valid as the pixel values of the examination area; an area dividing unit that divides an examination area with the approximate values determined to be invalid by the validity evaluating unit into a plurality of examination areas; an examination area re-setting unit that sets each area obtained by dividing the examination area by the area dividing unit as a new examination area and controls a repetition of processing; and an abnormal portion detecting unit that detects an abnormal portion based on the pixel values of the pixels in the image and the approximate values determined to be valid by the validity evaluating unit; wherein the validity evaluating unit includes an evaluation value calculating unit that calculates an evaluation value representing an approximation degree of at least one approximate value relative to at least one respective pixel value of the pixels of the examination area and evaluates whether the at least one approximate value is valid based on the evaluation value; wherein the evaluation value calculating unit calculates the evaluation value based on a difference between the at least one approximate value and the at least one respective pixel value of the pixels of the examination area; wherein the approximate value calculating unit calculates an approximate surface for the pixel value of each pixel of the examination area and sets a value on the approximate surface for each pixel of the examination area as the approximate value; wherein the approximate value calculating unit includes an approximation function calculating unit that calculates an approximation function of an input value for an output value, the input value indicating coordinates of a pixel in an examination area, and the output value indicating a pixel value at the coordinates used as the input value, and wherein the output value of the approximation function is defined as the approximate value for the pixel value of the pixel such that the approximate surface is obtained by the approximation function.