One of the backbones in electronic manufacturing industry is the printed circuit board (PCB) manufacturing. In the PCB manufacturing process, it is an important process to detect bare board defect. Till now inspection is done manual as well as automated (for example: subtraction method, morphological method, image processing algorithms) to eliminate all 14 defects classified as breakout, short, pin hole, wrong size hole, open circuit, conductor too close, under etch, spurious copper, mouse bite, excessive short, missing conductor, missing hole, spur and over etch which comes under the two category as fatal and potential defects. Due to the fatigue and speed requirement, manual inspection is ineffective to inspect every printed circuit board. Apart from above said defects, Misalignment error can also occur during printing of PCB due to malfunctioning of conveyer belt and/or machines. Hence, this paper propose an efficient algorithm for automated visual PCB inspection system that is able to automatically detect and correct Misalignment errors on PCBs by using Surf features and morphological operation along with detection of above mentioned 14 types of errors. The results presented in the papers are quite promising for misalignment error correction and detection.