A real-time approach for automatic defect detection from PCBs based on SURF features and morphological operations

  • Abdel-Aziz I. M. Hassanin
  • Fathi E. Abd El-Samie
  • Ghada M. El BanbyEmail author


This paper presents an automatic inspection approach for Printed Circuit Boards (PCBs) with accurate determination of the fault location and identification of the fault type. This approach depends on several digital image processing techniques including registration, filtering, foreground segmentation, mathematical morphological operations, subtraction, feature extraction, and component matching. The Speeded Up Robust Feature extraction (SURF) technique is used for two purposes: registration of the PCB to be checked to a reference PCB and detection of feature points of each missing component on the PCB that is localized from the subtraction process from the reference PCB. Operation is performed on the hue component of the color PCB images. A dictionary is first built for all possible components on the available PCBs with SURF feature descriptors, and hence if a missing item is detected on a PCB during the inspection process, the SURF feature descriptors for features extracted from the difference between the tested and reference PCBs at the position of the lost component are matched with those in the built dictionary or database. A distance metric is used in the matching process. The importance of the proposed approach lies in its ability to build a dictionary of feature descriptors for all possible components in a diversity of PCBs and its ability to localize and identify the missing components regardless of the PCB position, rotation, or type. All operations are formulated in a Graphical User Interface (GUI) using MATLAB environment.


Printed Circuit Boards Feature extraction SURF Morphological operations 



  1. 1.
    Alam F, Rahman SU, Ullah S, Gulati K (2018) Medical image registration in image guided surgery: issues, challenges and research opportunities. Biocybernetics and Biomedical Engineering 38:71–89CrossRefGoogle Scholar
  2. 2.
    Al-Obaidy F, Yazdani F, Mohammadi FA (2017) Fault detection using thermal image based on soft computing methods: comparative study. Microelectron Reliab 71:56–64CrossRefGoogle Scholar
  3. 3.
    Bay H, Ess A, Tuytelaars T, Gool LV (2011) Speeded-up robust features (SURF). Comput Vis Image Underst 110:346–359CrossRefGoogle Scholar
  4. 4.
    Chauhan V, Surgenor B (2015) A comparative study of machine vision based methods for fault detection in an automated assembly machine. Procedia Manufacturing 1:416–428CrossRefGoogle Scholar
  5. 5.
    Gonzalez RC, Woods RE (2002) Digital image processing, 2nd edn. Prentice Hall, Upper Saddle RiverGoogle Scholar
  6. 6.
    Harris C, Stephens M (1988) A combined corner and edge detector. In: Proceedings of the Alvey Vision Conference, p 147–151Google Scholar
  7. 7.
    Hu H, Liu Y, Liu M, Nie L (2016) Surface defect classification in large-scale strip steel image collection via hybrid chromosome genetic algorithm. Neurocomputing 181:86–95CrossRefGoogle Scholar
  8. 8.
    Huang W, Wei P (2018) A PCB dataset for defects detection and classification. Journal of Latex Class files 14Google Scholar
  9. 9.
    Kumar Y, Sharan SN (2017) Automatic misalignment defects detection & correction in PCB using SURF (Speed up Robust Features) technique. International Journal of Engineering Research & Technology (IJERT), ISSN: 2278–0181 IJERTV6IS010166 Vol. 6Google Scholar
  10. 10.
    Liu M, Zhang L, Liu Y, Hu H, Fang W (2017) Recognizing semantic correlation in image-text weibo via feature space mapping. Comput Vis Image Underst 163:58–66CrossRefGoogle Scholar
  11. 11.
    Maitre H (2008) Image processing. Wiley, LondonzbMATHGoogle Scholar
  12. 12.
    Malik F, Baharudin B (2013) Analysis of distance metrics in content based image retrieval using statistical quantized histogram texture features in the DCT domain. Journal of King Saud University- Computer and Information Sciences 25:207–218CrossRefGoogle Scholar
  13. 13.
    Muthugnanambika M, Padmavathi S (2017) Feature detection for color images using SURF. International Conference on Advanced Computing and Communication Systems, IEEEGoogle Scholar
  14. 14.
    Nayak JPR. et al (2017) Identification of PCB faults using image processing. International Conference on Electric, Electronic, Communication, Computer and Optimization technique, IEEE, p 742–745Google Scholar
  15. 15.
    Nerakae P, Uangpairoj P, Chamniprasart K (2016) Using machine vision for flexible automatic assembly system. Procedia Computer Science 96:428–435CrossRefGoogle Scholar
  16. 16.
    Pedersen JT (2011) Study group SURF: feature detection and description. Department of Computer Science, Aarhus University, Q4Google Scholar
  17. 17.
    Putera SH, Ibrahim Z (2010) Printed Circuit Board Defect Detection Using Mathematical Morphology and MAT LAB Image Processing Tools. 2nd International Conference on Education Technology and Computer (ICETC), IEEE, p 359–363Google Scholar
  18. 18.
    Putera SH, Dzafaruddin SF, Mohamad M (2012) MATLAB Based Defect Detection and Classification of Printed Circuit Board. Universiti Teknoogi MARA, Shah Alam, Malaysia, IEEE, p 115–119Google Scholar
  19. 19.
    Raj R, Joseph N (2016) Keypoint extraction using SURF algorithm for CMFD. Procedia Computer Science 93:375–381CrossRefGoogle Scholar
  20. 20.
    Soliman RF, El Banby Gh M., Algarni A D, Elsheikh M, Soliman NF, Amin M, Abd El-Samie FE (2018) Double random phase encoding for cancelable face and iris recognition. Appl Opt 57CrossRefGoogle Scholar
  21. 21.
    Zhang F, Qiao N, Li J (2017) A PCB photoelectric image edge information detection method. Optik 144:642–646CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2019

Authors and Affiliations

  • Abdel-Aziz I. M. Hassanin
    • 1
  • Fathi E. Abd El-Samie
    • 1
  • Ghada M. El Banby
    • 2
    Email author
  1. 1.Department of Electronics and Electrical Communications, Faculty of Electronic EngineeringMenoufia UniversityMenoufEgypt
  2. 2.Department of Industrial Electronics and Control Engineering, Faculty of Electronic EngineeringMenoufia UniversityMenoufEgypt

Personalised recommendations