By disposing a plurality of magnetic-field generating elements in the inserted
portion of an endoscope, and by detecting it using a magnetic-field detecting unit
disposed around the inserted portion, the shape of the inserted portion inserted
into a body cavity is detected and it is displayed on a display device. For this
purpose, it is determined whether the inserted portion is in an effective detection
range in which the insertion portion shape can be detected by a detecting unit
with a practicable accuracy, and by changing the display color of the inserted
portion shape based on the determination result, it can be easily checked whether
the inserted portion is in the effective detection range.