1. An image pickup device comprising: an image pickup section configured to take a subject-present image with a subject present in a background; a specification section configured to specify an image area which is contained in the subject-present image taken by the image pickup section and in which nonflatness is less than or equal to a predetermined value; a determination section configured to determine whether or not a range of the image area in the subject-present image specified by the specification section and in which the nonflatness is less than or equal to a predetermined value is greater than or equal to a predetermined range; a background generation section configured to generate an extraction background image used to extract a subject area in the subject-present image containing the subject, from the image area when the determination section determines that the range of the image area in which the nonflatness is less than or equal to a predetermined value is greater than or equal to the predetermined range; and a subject extraction section configured to extract the subject area from the subject-present image to obtain a subject area image, based on information on a difference between each pixel in the extraction background image and a corresponding pixel in the subject-present image.