In ordert to improve the efficiency of inspection for printed defect and meet the real-time requirement for printed defect inspection, the article is proposed to application of machine vision on on-line inspection for defect and studies related problems. The article designs the program of on-line inspection for printed defect and visual on-line inspection system of the hardware components based on DSP. The article also studies algorithm of image pre-processing, image processing and image registration. We improve these algorithms to meet the real-time requirement for printed defect inspection. We design the software named printed defect machine vision system. It proves that the inspection program and algorithm of image processing is feasible through simulating process of defect inspection.