Detecting Insertion Direction for an Automatic Endoscope