A system and method for ophthalmic surgery in which a portion of the light reflected by the eye passes through a lens that inverts the image and a portion of the light reflected by the eye does not pass through the lens. A digital image of both light that passed through the lens (lens image) and light that has not (peripheral image) is created using an image sensor. A processing resource identifies the boundary between the lens image and peripheral image and inverts at least a portion of either the lens image or the peripheral image to produce a corrected image in which no or only a small portion of the image is inverted as compared to the eye.