Machine learning for learning a characteristic amount of each pixel in a plurality of sample images, each including a particular region with a known contour, is performed in advance to obtain an evaluation function capable of evaluating whether or not each pixel is a pixel representing the contour based on the characteristic amount thereof. An arbitrary point is set within a particular region in an input image, and a discrimination region including the particular region is set in the input image with reference to the arbitrary point. A characteristic amount is obtained from each pixel within the discrimination region, then based on the characteristic amount, an evaluation value indicating whether or not each pixel within the discrimination region is a pixel representing the contour is calculated using the evaluation function, and the contour of the particular region in the input image is determined based on the evaluation value.