Through-focus scanning optical microscopy (TSOM) shows promise for patterned defect analysis, but it is important to minimize total system noise. TSOM is a three-dimensional shape metrology method that can achieve sub-nanometer measurement sensitivity by analyzing sets of images acquired through-focus using a conventional optical microscope. Here we present a systematic noise-analysis study for optimizing data collection and data processing parameters for TSOM and then demonstrate how the optimized parameters affect defect analysis. We show that the best balance between signalto- noise performance and acquisition time can be achieved by judicious spatial averaging. Correct background-signal subtraction of the imaging-system inhomogeneities is also critical, as well as careful alignment of the constituent images used in differential TSOM analysis.