1. A method of generating three-dimensional (3-D) information of a sample using an optical microscope, the method comprising: varying the distance between the sample and an objective lens of the optical microscope at pre-determined steps; capturing an image at each pre-determined step, wherein a first surface of the sample and a second surface of the sample are within a field of view of each of the captured images; determining a characteristic value of each pixel in each captured image; determining a first captured image that is focused on a first surface of the sample based on the characteristic value of each pixel in each captured image; and determining a measurement of an opening in the first surface of the sample based on the first captured image.