Disclosed are a system and method to accurately determine the location and orientation of a part of an elongated insertion shaft of an endoscope-like device or of an object located on or in the elongated insertion shaft when the elongated insertion shaft is inserted into a lumen or cavity of a human or animal body or into the interior of a manufactured object such that direct visual observation of the part of the elongated insertion shaft or of the object located on or in the elongated insertion shaft is blocked.