PROBLEM TO BE SOLVED: To measure a distance to a measurement object using a monocular endoscope.SOLUTION: A distance measuring method by an endoscope enables processing by changing over between: imaging processing of controlling a movable joint on the basis of a direction command from an input part to move a visual axis of an imaging part and output a captured image obtained by the imaging part; and ranging processing of controlling the movable joint based on a ranging controlled variable to execute moving processing of moving the visual axis of the imaging part, acquiring a first captured image captured before the execution of the moving processing, and a second captured image captured during the execution of the moving processing, and calculating a distance to a ranging object on the basis of the first captured image, the second captured image, and the ranging controlled variable.【課題】単眼の内視鏡を使用して測距対象までの距離測定を行う。【解決手段】本発明に係る内視鏡による距離測定方法は、入力部からの方向指示に基づいて可動関節を制御し、撮像部の視軸を移動させるとともに、撮像部が取得した撮像画像を出力する撮像処理と、測距制御量に基づき可動関節を制御して撮像部の視軸を移動させる移動処理を実行するとともに、移動処理実行前に撮像した第1の撮像画像と、移動処理実行中に撮像した第2の撮像画像を取得し、第1の撮像画像と第2の撮像画像と測距制御量に基づいて測距対象までの距離を算出する測距処理と、を切り替えて実行可能とする。【選択図】図8