An Automated Optical Inspection (AOI) algorithm for printed circuit board (PCB) inspection system proposed in this paper. The proposed method detect holes defect that occur during PCB etching process during manufacturing. The object of PCB inspection algorithm is to develop a more reliable and faster visual inspection system. The inspection process contains two stages, namely, measurement stage and detection stage. In the first stage, only one image feature is measured from the examined image and is used for detection of defects.