Skip to main content
Log in

A real-time two-stage and dual-check template matching algorithm based on normalized cross-correlation for industrial vision positioning

  • Industrial and Commercial Application
  • Published:
Pattern Analysis and Applications Aims and scope Submit manuscript

Abstract

In this paper, a fast template matching algorithm of two-stage and dual-check bounded partial correlation (TDBPC) based on normalized cross-correlation (NCC) of single-check bounded partial correlation is proposed. According to the principle of continuous rows, the template and the sub-image under matching are divided into three subregions to obtain two upper boundary terms of NCC and get two checking conditions then. In this way, it is possible to quickly eliminate matching points that cannot provide a better cross-correlation score regarding the current best candidate. Generally, to get the highest cross-correlation score, the sub-image has to traverse through the whole image. In addition, the two-stage search strategy of coarse–fine proposed in this paper can further reduce the calculation and improve matching efficiency. The initialization parameters are selected experimentally or automatically. Experimental results show that the TDBPC algorithm proposed in this paper can solve high computational complexity and long matching time of NCC template matching and make it possible to achieve real-time template matching in industrial vision positioning fields. The feasibility of this algorithm in practical application is proved.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

References

  1. Chen F, Ye X, Yin S, Ye Q, Huang S, Tang Q (2018) Automated vision positioning system for dicing semiconductor chips using improved template matching method. Int J Adv Manuf Technol 100:2669–2678

    Article  Google Scholar 

  2. Zhong F, He S, Li B (2017) Blob analyzation-based template matching algorithm for LED chip localization. Int J Adv Manuf Technol 93:55–63

    Article  Google Scholar 

  3. An Z, Wang Y (2018) A metal surface defect detection method based on nonlinear diffusion and image difference. Surf Technol (in Chinese) 47:277–283. https://doi.org/10.16490/j.cnki.issn.1001-3660.2018.06.040

    Article  Google Scholar 

  4. Wan Y, Cui P, Xu L, Yu H (2019) Anti-icing performance of micro-nano composite texture based on image processing technology. Surf Technol (in Chinese) 48:54–58. https://doi.org/10.16490/j.cnki.issn.1001-3660.2019.08.008

    Article  Google Scholar 

  5. Connell SD, Jain AK (2001) Template-based online character recognition. Pattern Recognit 34:1–14

    Article  Google Scholar 

  6. Lowe DG (2004) Distinctive image features from scale-invariant keypoints. Int J Comput Vis 60:91–110

    Article  Google Scholar 

  7. Wu X, Zhao Q, Bu W (2014) A SIFT-based contactless palmprint verification approach using iterative RANSAC and local palmprint descriptors. Pattern Recognit 47:3314–3326

    Article  Google Scholar 

  8. Bay H, Ess A, Tuytelaars T (2008) Speeded-up robust features (SURF). Comput Vis Image Underst 110:346–359

    Article  Google Scholar 

  9. Teh CH, Chin RT (1988) On image analysis by the methods of moments. IEEE Trans Pattern Anal 10:496–513

    Article  Google Scholar 

  10. Hwang SK, Kim WY (2006) A novel approach to the fast computation of Zernike moments. Pattern Recognit 39:2065–2076

    Article  Google Scholar 

  11. Wee CY, Paramesran R (2007) On the computational aspects of Zernike moments. Image Vis Comput 25:967–980

    Article  Google Scholar 

  12. Revaud J, Lavoue G, Baskurt A (2009) Improving Zernike moments comparison for optimal similarity and rotation angle retrieval. IEEE Trans Pattern Anal Mach Intell 31:627–636

    Article  Google Scholar 

  13. Barnea DI, Silverman HF (1972) A class of algorithms for fast digital image registration. IEEE Trans Comput C–21:179–186

    Article  Google Scholar 

  14. Bei CD, Gray RM (1985) An improvement of the minimum distortion encoding algorithm for vector quantization. IEEE Trans Commun com-33:1132–1133

    Google Scholar 

  15. Li W, Salari E (1995) Successive elimination algorithm for motion estimation. IEEE T Image Process 4:105–107

    Article  Google Scholar 

  16. Wang HS, Mersereau RM (1999) Fast algorithms for the estimation of motion vectors. IEEE T Image Process 8:435–439

    Article  Google Scholar 

  17. Atallah MJ (2001) Faster image template matching in the sum of absolute value of differences measure. IEEE Trans Image Process 10:659–663

    Article  MathSciNet  Google Scholar 

  18. Essannouni F, Thami ROH, Aboutajdine D, Salam A (2007) Adjustable SAD matching algorithm using frequency domain. J Real Time Image Process 1:257–265

    Article  Google Scholar 

  19. Briechle K, Hanebeck UD (2001) Template matching using fast normalized cross correlation. Opt Pattern Recogn XII 4387:95–102

    Article  Google Scholar 

  20. Cooley J, Lewis P, Welch P (1967) Application of the fast fourier transform to computation of Fourier integrals, Fourier series, and convolution integrals. IEEE Trans Audio Electroacoust 15:79–84

    Article  Google Scholar 

  21. Rao KR, Kim DN, Hwang JJ (2010) Fast Fourier transform algorithms and applications. In: Signals and communication technology

  22. Park CS (2015) 2D discrete Fourier transform on sliding windows. IEEE Trans Image Process 24:901–907

    Article  MathSciNet  Google Scholar 

  23. Kaso A (2018) Computation of the normalized cross-correlation by fast Fourier transform. PLoS One 13:e0203434

    Article  Google Scholar 

  24. Lewis JP (1995) Fast template matching. In: Vision interface 95, Canadian image processing and pattern recognition society Quebec City, Canada, May 15, vol 19, pp 120–123

  25. Stefano LD, Mattoccia S (2003) Fast template matching using bounded partial correlation. Mach Vis Appl 13:213–221

    Article  Google Scholar 

  26. Stefano LD, Mattoccia S (2003) A sufficient condition based on the Cauchy-Schwarz inequality for efficient template matching. In: International conference on image processing, pp 269–272

  27. Mattoccia S, Tombari F, Di Stefano L (2008) Fast full-search equivalent template matching by enhanced bounded correlation. IEEE Trans Image Process 17:528–538

    Article  MathSciNet  Google Scholar 

  28. Wen-Chia L, Chin-Hsing C (2012) A fast template matching method with rotation invariance by combining the circular projection transform process and bounded partial correlation. IEEE Signal Proc Lett 19:737–740

    Article  Google Scholar 

  29. Wong RY, Hall EL (1978) Sequential hierarchical scene matching. IEEE Trans Comput 27:359–366

    Article  MathSciNet  Google Scholar 

  30. Vanderburg G, Rosenfeld A (1977) Two-stage template matching. IEEE Trans Comput 1:104–107

    Google Scholar 

  31. Choi MS, Kim WY (2002) A novel two stage template matching method for rotation and illumination invariance. Pattern Recognit 35:119–129

    Article  Google Scholar 

  32. Krattenthaler W, Mayer K, M.Zeiler (1994) point correlation: a reduced-cost template matching technique. In: International conference on image processing, pp 208–212

  33. Ouyang W, Tombari F, Mattoccia S, Di Stefano L, Cham WK (2012) Performance evaluation of full search equivalent pattern matching algorithms. IEEE Trans Pattern Anal Mach Intell 34:127–143

    Article  Google Scholar 

  34. Itamar I, Mechres R, Zelnik-Manor L (2017) Template matching with deformable diversity similarity. In: The IEEE conference on computer vision and pattern recognition, pp 175–183

  35. Korman S, Milam M, Soatto S (2018) OATM: occlusion aware template matching by consensus set maximization. In: The IEEE conference on computer vision and pattern recognition, pp 2675–2683

  36. Oron S, Dekel T, Xue T, Freeman WT (2018) Best-buddies similarity—Robust template matching using mutual nearest neighbors. IEEE Trans Pattern Anal Mach Intell 40:1799–1813

    Article  Google Scholar 

  37. Lai J, Lei L, Deng K, Yan R, Ruan Y, Jinyun Z (2020) Fast and robust template matching with majority neighbour similarity and annulus projection transformation. Pattern Recognit 98:107029

    Article  Google Scholar 

  38. McDonnell MJ (1981) Box-filtering technique. Comput Graph Image Process 17:65–70

    Article  Google Scholar 

  39. MacLean J, Tsotsos J (2000) Fast pattern recognition using gradient-descent search in an image pyramid. In: International conference on pattern recognition, pp 873–877

  40. Takei R (2003) A new grey-scale template image matching algorithm using the cross-sectional histogram correlation method. Dynax Corporation Fuchu-City, Fuchu-cho

Download references

Acknowledgements

The funding was provided by the National Natural Science Foundation of China (Grant Nos. 51975204).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Fengjun Chen.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Chen, F., Liao, J., Lu, Z. et al. A real-time two-stage and dual-check template matching algorithm based on normalized cross-correlation for industrial vision positioning. Pattern Anal Applic 24, 1427–1439 (2021). https://doi.org/10.1007/s10044-021-00997-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10044-021-00997-7

Keywords

Navigation