An imaging mode is automatically switched based on the kind of a subject. The spatial frequency of an endoscopic image obtained by imaging the subject is detected. Further, judgment is made, based on the distribution of the spatial frequency, as to whether the endoscopic image was obtained by performing close-up imaging on the subject. The condition of imaging is switched based on the result of judgment as to whether the image was obtained by close-up imaging or distant-view imaging.