Confocal microscopy is an optical imaging technique for increasing optical resolution and contrast of a micrograph by means of adding a spatial pinhole placed at the confocal plane of the lens to eliminate out-of-focus light. It enables the reconstruction of three-dimensional structures from the obtained images. This technique has gained popularity in the scientific and industrial communities and typical applications are in life sciences, semiconductor inspection and materials science.