With the rapid development of electronic industry, higher and higher requirements are placed on the surface quality of optical components in electronic devices. Structured-Light Modulation Analysis Technique (SMAT) was recently proposed to detect the contamination and defects on specular surfaces. In this paper, the proposed mechanisms and mathematical models of SMAT are analyzed and established based on the theory of photometry and the optical characteristics of contamination and defects for the first time. What's more, a novel transmission system adopting SMAT is especially designed for the defect detection of transparent objects. For both reflection and transmission system, simulations and experiments were conducted, and comparative studies with uniform planar illumination were also carried out. Simulations on the influence of incident light source region showed that SMAT can eliminate the interference of ambient light while uniform planar illumination technique cannot. Experiments on samples with specular surface and transparent material demonstrated that the modulation values at the contamination and defects are much less than that at clean and intact place, and defects and contaminations were clearly distinguished based on SMAT, while they were almost indiscernible with uniform planar illumination. Therefore, SMAT can be applied to the whole-field inspection of optical components in industrial environments.