A medical device for examination or treatment based on a reference point A1, including: a virtual endoscopic image generation section configured to generate a virtual endoscopic image from a plurality of different sight line positions using three-dimensional image data of a bronchus that is obtained in advance an image retrieving section configured to retrieve a virtual endoscopic image highly similar to a real image a reference-point setting section configured to set the reference point A1 based on a line-of-sight position A0 of the highly similar virtual endoscopic image a relative-position calculation section configured to calculate a relative position of a treatment instrument to the reference point A1 a movement detection section configured to detect a movement of the reference point A1 or the bronchus and a position correction section configured to correct the relative position in response to the movement of the reference point A1 or the bronchus.