A medical system comprising: a medical device; an image capturing device configured to capture a sequence of images from a perspective of a distal end of the medical device while the medical device is moving through a path including a plurality of lumens in a branched anatomical structure; a memory configured to store information of a computer model of the branched anatomical structure; and a processor programmed to register the computer model to the medical device for determining a position of the medical device in the branched anatomical structure by: extracting information of lumens appearing in the sequence of images by extracting dark regions from the sequence of images so that each lumen appearing in the sequence of images is indicated by one of the extracted dark regions, determining a first ratio of dimensions related to a first extracted dark region appearing in a first image of the sequence of images, determining a second ratio of dimensions related to a second extracted dark region appearing in the first image, and determining an angle defined by (i) a first line extending from a first centroid of the first extracted dark region to a second centroid of the second extracted dark region, and (ii) a second reference line; and determining that a generated sequence of images, generated based on the computer model of the branched anatomical structure, substantially matches the sequence of images, the determination comprising comparing the first ratio of dimensions, the second ratio of dimensions, and the angle, as determined from the sequence of images, with corresponding lumen information extracted from the computer model of the branched anatomical structure; and responsive to determining that the generated sequence substantially matches the sequence of images, determining a location of the distal end within the branched anatomical structure based on a location represented by the generated sequence of images. a medical device; an image capturing device configured to capture a sequence of images from a perspective of a distal end of the medical device while the medical device is moving through a path including a plurality of lumens in a branched anatomical structure; a memory configured to store information of a computer model of the branched anatomical structure; and a processor programmed to register the computer model to the medical device for determining a position of the medical device in the branched anatomical structure by: extracting information of lumens appearing in the sequence of images by extracting dark regions from the sequence of images so that each lumen appearing in the sequence of images is indicated by one of the extracted dark regions, determining a first ratio of dimensions related to a first extracted dark region appearing in a first image of the sequence of images, determining a second ratio of dimensions related to a second extracted dark region appearing in the first image, and determining an angle defined by (i) a first line extending from a first centroid of the first extracted dark region to a second centroid of the second extracted dark region, and (ii) a second reference line; and determining that a generated sequence of images, generated based on the computer model of the branched anatomical structure, substantially matches the sequence of images, the determination comprising comparing the first ratio of dimensions, the second ratio of dimensions, and the angle, as determined from the sequence of images, with corresponding lumen information extracted from the computer model of the branched anatomical structure; and responsive to determining that the generated sequence substantially matches the sequence of images, determining a location of the distal end within the branched anatomical structure based on a location represented by the generated sequence of images. extracting information of lumens appearing in the sequence of images by extracting dark regions from the sequence of images so that each lumen appearing in the sequence of images is indicated by one of the extracted dark regions, determining a first ratio of dimensions related to a first extracted dark region appearing in a first image of the sequence of images, determining a second ratio of dimensions related to a second extracted dark region appearing in the first image, and determining an angle defined by (i) a first line extending from a first centroid of the first extracted dark region to a second centroid of the second extracted dark region, and (ii) a second reference line; and determining that a generated sequence of images, generated based on the computer model of the branched anatomical structure, substantially matches the sequence of images, the determination comprising comparing the first ratio of dimensions, the second ratio of dimensions, and the angle, as determined from the sequence of images, with corresponding lumen information extracted from the computer model of the branched anatomical structure; and responsive to determining that the generated sequence substantially matches the sequence of images, determining a location of the distal end within the branched anatomical structure based on a location represented by the generated sequence of images.