A Hardware–Software Integrated PCB Image Registration Method Based on Local Adaptive KNN and SIFT
Abstract
1. Introduction
2. System Architecture and Main Functions
2.1. Hardware Design and Implementation
2.2. Image Acquisition and Processing
2.3. Feature-Point Detection and Descriptor Extraction
2.3.1. Construction of Scale Space
2.3.2. Key Point Detection
2.3.3. Precise Location of Key Points
2.3.4. Direction Assignment
2.3.5. Feature Descriptor Computation
2.4. Feature-Point Matching
2.5. Homography Matrix Generation and Mask Generation
2.6. Resulting Image Generation
2.7. Accuracy Assessment Based on the Ray Method
3. Proposed Image Registration Method
3.1. Introduction to Traditional Image Registration Methods
3.1.1. Brute-Force Matching (BF Match)
3.1.2. Cross-Matching (Cross-Check)
3.1.3. Fast Library for Approximate Nearest Neighbors (FLANN)
3.1.4. Random Sample Consensus (RANSAC)
3.1.5. K-Nearest Neighbors Matching (KNN Match)
3.2. PCB Image Registration Method Based on LAKNN and SIFT
3.2.1. Adaptive K Value Collaborative Adjustment Strategy
3.2.2. Characteristic Distance Calculation and Matching Discrimination
4. Experimental Verification
4.1. Dataset, Target PCB and Evaluation Setup
4.2. Experiment 1: PCB Images for Different Heights
4.3. Experiment 2: PCB Images for Different Regions
4.4. Experiment 3: PCB Images from Different Perspectives
4.5. Ablation Experiment
4.6. Discussion of Hardware–Software Synergy
5. Conclusions and Future Work
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Ulger, F.; Yuksel, S.E.; Yilmaz, A.; Gokcen, D. Solder joint inspection on printed circuit boards: A survey and a dataset. IEEE Trans. Instrum. Meas. 2023, 72, 2515121. [Google Scholar] [CrossRef]
- Li, C.Y.; Zhang, P.; Wang, S.M.; Liu, L.; Shi, M.Q. Industrial fusion cascade detection of solder joint. Comput. Mater. Contin. 2024, 81, 1197–1214. [Google Scholar] [CrossRef]
- Si, S.; Li, Z.; Lin, Z.; Xu, X.; Zhang, Y.; Xie, S. A robust 2D/3D medical image registration based on feature-point matching. IEEE Trans. Instrum. Meas. 2024, 73, 5037609. [Google Scholar] [CrossRef]
- Zheng, J.; Peng, W.; Wang, Y.; Zhai, B. Accelerated RANSAC for accurate image registration in aerial video surveillance. IEEE Access 2021, 9, 36775–36790. [Google Scholar] [CrossRef]
- Hu, B.; Wang, J. Detection of PCB surface defects with improved faster-RCNN and feature pyramid network. IEEE Access 2020, 8, 108335–108345. [Google Scholar] [CrossRef]
- Dai, L.; Guan, Q.; Liu, H. Robust image registration of printed circuit boards using improved SIFT-PSO algorithm. J. Eng. 2018, 2018, 1793–1797. [Google Scholar] [CrossRef]
- Ling, Q.; Isa, N.A.M. Printed circuit board defect detection methods based on image processing, machine learning and deep learning: A survey. IEEE Access 2023, 11, 15921–15944. [Google Scholar] [CrossRef]
- Dai, W.; Mujeeb, A.; Sourin, A. Soldering defect detection in automatic optical inspection. Adv. Eng. Inform. 2020, 43, 100975. [Google Scholar] [CrossRef]
- Hossein-Nejad, Z.; Nasri, M. An adaptive image registration method based on SIFT features and RANSAC transform. Comput. Electr. Eng. 2017, 62, 524–537. [Google Scholar] [CrossRef]
- LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef] [PubMed]
- Sushma Sri, M.; Rajendra Naik, B.; Jaya Sankar, K. Object detection based on Faster R-CNN. Int. J. Eng. Adv. Technol. 2021, 10, 72–76. [Google Scholar] [CrossRef]
- Lowe, D.G. Distinctive image features from scale-invariant keypoints. Int. J. Comput. Vis. 2004, 60, 91–110. [Google Scholar] [CrossRef]
- Bay, H.; Ess, A.; Tuytelaars, T.; Van Gool, L. Speeded-up robust features (SURF). Comput. Vis. Image Underst. 2008, 110, 346–359. [Google Scholar] [CrossRef]
- Yong, A.; Hong, Z. SIFT matching method based on K nearest neighbor support feature points. In Proceedings of the 2016 IEEE International Conference on Signal and Image Processing (ICSIP), Beijing, China, 13–15 August 2016; pp. 64–68. [Google Scholar] [CrossRef]
- Martínez-Otzeta, J.M.; Rodríguez-Moreno, I.; Mendialdua, I.; Sierra, B. RANSAC for robotic applications: A survey. Sensors 2023, 23, 327. [Google Scholar] [CrossRef] [PubMed]
- Muja, M.; Lowe, D.G. Scalable nearest neighbor algorithms for high dimensional data. IEEE Trans. Pattern Anal. Mach. Intell. 2014, 36, 2227–2240. [Google Scholar] [CrossRef] [PubMed]
- Tsourounis, D.; Kastaniotis, D.; Theoharatos, C.; Kazantzidis, A.; Economou, G. SIFT-CNN: When convolutional neural networks meet dense SIFT descriptors for image and sequence classification. J. Imaging 2022, 8, 256. [Google Scholar] [CrossRef] [PubMed]
- Zhao, W.; Tabak, E.G. Adaptive kernel conditional density estimation. Inf. Inference J. IMA 2025, 14, iaae037. [Google Scholar] [CrossRef]
- Bhattacharya, A.; Cloutier, S.G. End-to-end deep learning framework for printed circuit board manufacturing defect classification. Sci. Rep. 2022, 12, 12559. [Google Scholar] [CrossRef] [PubMed]
- Zhang, Z.; Zhang, W.; Zhu, D.; Xu, Y.; Zhou, C. Printed circuit board solder joint quality inspection based on lightweight classification network. IET Cyber-Syst. Robot. 2023, 5, e12101. [Google Scholar] [CrossRef]
- Deng, S.; Deng, L.; Meng, X.; Sun, T.; Chen, B.; Chen, Z.; Hu, H.; Xie, Y.; Yin, H.; Yu, S. EHIR: Energy-based hierarchical iterative image registration for accurate PCB defect detection. Pattern Recognit. Lett. 2024, 185, 38–44. [Google Scholar] [CrossRef]
- Misra, I.; Rohil, M.K.; Subbiah, M.M.; Dhar, D. Feature based remote sensing image registration techniques: A comprehensive and comparative review. Int. J. Remote Sens. 2022, 43, 4477–4516. [Google Scholar] [CrossRef]
- Liu, C.; Xu, J.; Wang, F. A review of keypoints’ detection and feature description in image registration. Sci. Program. 2021, 2021, 8509164. [Google Scholar] [CrossRef]
- Joglekar, J.; Gedam, S.S.; Mohan, B.K. Image matching using SIFT features and relaxation labeling technique—A constraint initializing method for dense stereo matching. IEEE Trans. Geosci. Remote Sens. 2014, 52, 5643–5652. [Google Scholar] [CrossRef]
- Noble, F.K. Comparison of OpenCV’s feature detectors and feature matchers. In Proceedings of the 2016 23rd International Conference on Mechatronics and Machine Vision in Practice (M2VIP), Nanjing, China, 28–30 November 2016; pp. 1–6. [Google Scholar] [CrossRef]
- Wang, S.; Guo, Z.; Liu, Y. An image matching method based on sift feature extraction and FLANN search algorithm improvement. J. Phys. Conf. Ser. 2021, 2037, 012037. [Google Scholar] [CrossRef]
- Bo, D.; Liang, Z.G.; Long, C.X. An algorithm of image matching based on mahalanobis distance and weighted KNN graph. In Proceedings of the 2015 2nd International Conference on Information Science and Control Engineering, Shanghai, China, 24–26 April 2015; pp. 116–121. [Google Scholar] [CrossRef]
- Chum, O.; Matas, J. Optimal randomized RANSAC. IEEE Trans. Pattern Anal. Mach. Intell. 2008, 30, 1472–1482. [Google Scholar] [CrossRef] [PubMed]
- Ye, Y.; Guangrui, F.; Shiqi, O. An algorithm for judging points inside or outside a polygon. In Proceedings of the 2013 Seventh International Conference on Image and Graphics, Qingdao, China, 26–28 July 2013; pp. 690–693. [Google Scholar] [CrossRef]
- Li, W.; Zhang, Y.; Sun, Y.; Wang, W.; Li, M.; Zhang, W.; Lin, X. Approximate nearest neighbor search on high dimensional data—Experiments, analyses, and improvement. IEEE Trans. Knowl. Data Eng. 2019, 32, 1475–1488. [Google Scholar] [CrossRef]
- Chatterjee, B.; Walulya, I.; Tsigas, P. Concurrent linearizable nearest neighbour search in LockFree-KD-tree. Theor. Comput. Sci. 2021, 886, 27–48. [Google Scholar] [CrossRef]
- Sangappa, H.K.; Ramakrishnan, K.R. A probabilistic analysis of a common RANSAC heuristic. Mach. Vis. Appl. 2019, 30, 71–89. [Google Scholar] [CrossRef]
- Cao, M.; Jia, W.; Lv, Z.; Li, Y.; Xie, W.; Zheng, L.; Liu, X. Fast and robust feature tracking for 3D reconstruction. Opt. Laser Technol. 2019, 110, 120–128. [Google Scholar] [CrossRef]
- Dufournaud, Y.; Schmid, C.; Horaud, R. Image matching with scale adjustment. Comput. Vis. Image Underst. 2004, 93, 175–194. [Google Scholar] [CrossRef]
- Hua, G.; Huang, W.; Liu, H. Accurate image registration method for PCB defects detection. J. Eng. 2018, 2018, 1662–1667. [Google Scholar] [CrossRef]












| Rate | BF | BF_CrossCheck | FLANN | KNN_Low | KNN_High | LAKNN |
|---|---|---|---|---|---|---|
| 1 cm | 0.3% | 11.4% | 5.0% | 0.0% | 3.7% | 20.0% |
| 2 cm | 0.6% | 18.1% | 7.6% | 40.0% | 5.5% | 50.0% |
| 3 cm | 0.8% | 16.2% | 3.8% | 21.9% | 3.6% | 33.3% |
| 5 cm | 1.2% | 22.6% | 19.1% | 78.6% | 16.8% | 81.8% |
| 8 cm | 3.3% | 22.7% | 15.5% | 66.7% | 12.9% | 70.0% |
| 11 cm | 5.3% | 21.4% | 26.6% | 36.6% | 25.5% | 43.8% |
| 14 cm | 7.5% | 21.5% | 34.0% | 44.4% | 30.9% | 46.2% |
| Average | 2.7% | 19.1% | 15.9% | 41.2% | 14.1% | 49.3% |
| Rate | BF | BF_CrossCheck | FLANN | KNN_Low | KNN_High | LAKNN |
|---|---|---|---|---|---|---|
| Area1 | 1.2% | 22.6% | 19.1% | 78.6% | 16.8% | 81.8% |
| Area2 | 0.7% | 13.7% | 7.5% | 52.0% | 6.2% | 63.6% |
| Area3 | 1.0% | 20.4% | 12.3% | 85.0% | 10.1% | 86.7% |
| Area4 | 0.6% | 15.8% | 6.9% | 85.7% | 5.4% | 91.7% |
| Average | 0.9% | 18.1% | 11.5% | 75.3% | 9.6% | 81.0% |
| Rate | BF | BF_CrossCheck | FLANN | KNN_Low | KNN_High | LAKNN |
|---|---|---|---|---|---|---|
| 0° | 21.0% | 22.6% | 75.0% | N/A | 70.8% | 90.0% |
| 2° | 21.6% | 22.1% | 68.4% | N/A | 71.8% | 88.2% |
| 3° | 23.1% | 22.1% | 68.4% | N/A | 69.2% | 77.8% |
| 5° | 11.2% | 13.9% | 63.9% | N/A | 59.5% | 66.7% |
| 10° | 9.7% | 10.9% | 42.9% | N/A | 44.4% | 66.7% |
| 15° | 12.1% | 13.6% | 57.7% | N/A | 56.5% | 60.0% |
| 20° | 13.5% | 15.3% | 62.9% | N/A | 68.3% | 92.3% |
| 25° | 10.8% | 13.1% | 57.1% | N/A | 61.2% | 87.3% |
| 30° | 6.9% | 9.4% | 34.7% | N/A | 38.9% | 73.8% |
| Average | 14.4% | 15.9% | 59.0% | N/A | 60.1% | 78.1% |
| Rate | BF | BF_CrossCheck | FLANN | KNN_Low | KNN_High | LAKNN |
|---|---|---|---|---|---|---|
| 0° | 1.2% | 22.6% | 19.1% | 78.6% | 16.8% | 81.8% |
| 2° | 1.1% | 22.1% | 15.8% | 62.5% | 12.1% | 62.5% |
| 3° | 1.2% | 24.1% | 12.4% | 78.6% | 10.6% | 80.0% |
| 5° | 1.0% | 13.9% | 10.5% | 71.4% | 8.2% | 83.3% |
| 10° | 0.9% | 10.9% | 5.1% | 62.5% | 4.6% | 72.7% |
| 15° | 0.8% | 13.6% | 6.0% | 35.7% | 4.9% | 35.7% |
| 20° | 0.9% | 15.3% | 12.4% | 66.7% | 9.4% | 72.7% |
| 25° | 0.8% | 13.1% | 8.3% | 48.1% | 6.9% | 68.9% |
| 30° | 0.5% | 7.9% | 5.2% | 27.6% | 4.1% | 61.7% |
| Average | 0.9% | 15.9% | 10.5% | 59.1% | 8.6% | 68.8% |
| Method | Adaptive K | Confidence Weighting | Inlier Accuracy | Avg. Matching Time | Improvement |
|---|---|---|---|---|---|
| KNN-Basic | No | No | 78.6% | 0.095 s | Baseline |
| LAKNN-FixedK | No | Yes | 84.5% | 0.102 s | +5.9 p.p. |
| LAKNN-NoConf | Yes | No | 86.5% | 0.108 s | +7.9 p.p. |
| LAKNN-Full | Yes | Yes | 90.8% | 0.112 s | +12.2 p.p. |
| Method | Mean Matching Time | Relative Change vs. BF |
|---|---|---|
| BF | 0.186 s | Baseline |
| BF_CrossCheck | 0.228 s | +22.6% |
| FLANN | 0.082 s | −55.9% |
| KNN_Low | 0.096 s | −48.4% |
| KNN_High | 0.101 s | −45.7% |
| LAKNN | 0.112 s | −39.8% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Su, W.; Fan, E.; Wang, J.; Ling, S.; Fang, Z. A Hardware–Software Integrated PCB Image Registration Method Based on Local Adaptive KNN and SIFT. Sensors 2026, 26, 4858. https://doi.org/10.3390/s26154858
Su W, Fan E, Wang J, Ling S, Fang Z. A Hardware–Software Integrated PCB Image Registration Method Based on Local Adaptive KNN and SIFT. Sensors. 2026; 26(15):4858. https://doi.org/10.3390/s26154858
Chicago/Turabian StyleSu, Wenjie, En Fan, Jilong Wang, Siyu Ling, and Zhaoxi Fang. 2026. "A Hardware–Software Integrated PCB Image Registration Method Based on Local Adaptive KNN and SIFT" Sensors 26, no. 15: 4858. https://doi.org/10.3390/s26154858
APA StyleSu, W., Fan, E., Wang, J., Ling, S., & Fang, Z. (2026). A Hardware–Software Integrated PCB Image Registration Method Based on Local Adaptive KNN and SIFT. Sensors, 26(15), 4858. https://doi.org/10.3390/s26154858

