An endoscope image is obtained by imaging a subject with a scope. Then, an edge portion of the endoscope image is extracted and a complexity degree of the edge portion is detected. Thereafter, a determination is made as to whether the endoscope image is an image obtained through near view imaging or distant view imaging according to the complexity degree and an imaging condition is changed according to the determined near view imaging or distant view imaging.