Dexterous manipulation of intraocular microrobotic devices has the potential to significantly augment ophthalmic surgeons' capabilities. Microrobots can be employed for targeted drug delivery and for procedures such as retinal-vein cannulation that require a high degree of dexterity. For precise externally generated magnetic control of microdevices, their position in the magnetic field is needed. Since the interior of the human eye is externally observable, computer-vision techniques can be used for localization. In this paper, the complex optics of the human eye are taken into account, and an algorithm that localizes microrobotic devices based on their 3-D structure is proposed. The sensitivity of the algorithm with respect to uncertainties in optical parameters is evaluated. A human-like model eye is designed and fabricated for experiments, precision analysis is performed, and the algorithm is used for visual servoing.