The invention describes an ophthalmic device capable of obtaining B-scan graphical images at high speed while eliminating positional displacement due to movement of a subject eye. The device includes: anterior eye image obtaining means configured to obtain an image of an anterior eye of a subject eye eye fundus image obtaining means configured to obtain an image of an eye fundus of the subject eye and control means configured to detect a moving distance of the subjects eye in the anterior eye image using means configured to calculate correlation between a moving distance of the subjects eye in the anterior eye image and a moving distance in the eye fundus image, and to control a position for imaging of the eye fundus image based on the detected moving distance of the subjects eye and the calculated correlation.