《電子技術應用》
您所在的位置:首頁 > 其他 > 設計應用 > 基于局部方差和后驗概率分類的快速模板匹配算法*
基于局部方差和后驗概率分類的快速模板匹配算法*
電子技術應用
林煜桐1,朱姍姍2,彭凌西3,彭紹湖1,謝翔1,林煥然1
(1.廣州大學 電子與通信工程學院, 廣東 廣州 510006;2.廣東白云學院 電氣與信息工程學院, 廣東 廣州 510450; 3.廣州大學 機械與電氣工程學院, 廣東 廣州 510006)
摘要: 具有旋轉(zhuǎn)不變性的模板匹配算法在工業(yè)制造上具有廣泛的應用。為解決傳統(tǒng)的模板匹配方法在目標旋轉(zhuǎn)、匹配速度上的問題,提出一種基于局部方差和后驗概率分類的模板匹配方法。為減少計算量,在匹配中通過局部方差過濾掉部分候選窗口,并在后驗概率分類模塊中通過對比不同區(qū)域穩(wěn)定特征點對的灰度來計算窗口相關性。使用后驗概率分類計算窗口相關度能在預處理過程實現(xiàn)旋轉(zhuǎn)不變性,并保證準確率在95%以上。實驗結(jié)果表明,該算法在80萬像素級的任意角度匹配圖像上選擇合適的窗口移動步長后,可將匹配時間減少到10 ms以內(nèi),相較于現(xiàn)有算法速度更快。
中圖分類號:TP391.41 文獻標志碼:A DOI: 10.16157/j.issn.0258-7998.233881
中文引用格式: 林煜桐,朱姍姍,彭凌西,等. 基于局部方差和后驗概率分類的快速模板匹配算法[J]. 電子技術應用,2023,49(9):97-102.
英文引用格式: Lin Yutong,Zhu Shanshan,Peng Lingxi,et al. Fast template matching based on local variance and posterior probability classification[J]. Application of Electronic Technique,2023,49(9):97-102.
Fast template matching based on local variance and posterior probability classification
Lin Yutong1,Zhu Shanshan2,Peng Lingxi3,Peng Shaohu1,Xie Xiang1,Lin Huanran1
(1.School of Electronics and Communication Engineering, Guangzhou University, Guangzhou 510006, China; 2.Faculty of Electronic and Information Engineering, Guangdong Baiyun University, Guangzhou 510450,China; 3.School of Mechanical and Electrical Engineering, Guangzhou University, Guangzhou 510006, China)
Abstract: Template matching algorithm with rotation invariant is widely used in industrial manufacturing. To solve the problems of traditional template matching methods such as target rotation and matching speed, a template matching method based on local variance and posterior probability classification is proposed. To reduce the amount of computation, some candidate windows are filtered out by local variance in the matching process, and window correlation is calculated by comparing the gray levels of stable feature points in different regions in the posterior probability classification module. Using posterior probability classification to calculate window correlation can achieve rotation invariant during preconditioning and ensure that the accuracy is above 95%. Experimental results show that the algorithm can reduce the matching time to less than 10 ms after selecting the appropriate sliding window moving step on 800 000 pixel-level arbitrary angle matching images, which is faster than the existing algorithms.
Key words : machine vision;template matching;local variance;stable pixels;posterior probability classification

0 引言

模板匹配是計算機視覺領域的一種經(jīng)典算法[1-2],在實際工業(yè)應用中用于目標定位。它的基本思想是僅憑模板圖像的先驗知識,在目標圖像中找到與模板圖像最相似的匹配區(qū)域,其匹配思路可以分為基于灰度[3]、基于特征點[4]和基于形狀[5]。

基于灰度的方法[6-8]通過計算灰度的差異來估計模板圖像和候選窗口的相似度,其中NCC以及基于NCC的方法[9-10]在線性光照變化的場景有著廣泛的應用?;诨叶鹊钠ヅ浞椒ㄋ悸泛唵?,性價比較高,但是考慮目標旋轉(zhuǎn)的情況后匹配時間會大大增長[11]。

基于特征點的方法如SIFT[12]、SURF[13]和BBS[14],該類方法以特征點作為匹配單元,不依賴于滑動窗口遍歷,因此可很好地解決目標旋轉(zhuǎn)、比例變化、變形等問題,但是匹配時的計算量和內(nèi)存占用較大,而且實際工業(yè)應用中的目標大小和背景亮度都已經(jīng)固定,所以這類方法一般不會成為工業(yè)目標檢測的首要考慮。

基于形狀的方法[15-16]通過提取模板的輪廓得到形狀信息,在匹配中以形狀為單位進行相似度計算來實現(xiàn)匹配[17],這類方法在邊緣特征明顯的模板匹配任務上有著很好的發(fā)揮[18],但是這準確率非常依賴于線段擬合的結(jié)果和模板的類型,而且目標旋轉(zhuǎn)也會影響匹配效果。

對工業(yè)于生產(chǎn)線上的模板匹配,如缺陷檢測[19]和目標定位[20],最大的挑戰(zhàn)是檢測目標的旋轉(zhuǎn)、匹配速度問題。為克服這些問題,本文提出一種基于局部方差后驗概率分類的快速模板匹配算法,實驗結(jié)果表明,本方法在目標旋轉(zhuǎn)的情況下能實現(xiàn)快速的目標定位,能夠滿足實時性和準確性要求。



本文詳細內(nèi)容請下載:http://ihrv.cn/resource/share/2000005645




作者信息:

林煜桐1,朱姍姍2,彭凌西3,彭紹湖1,謝翔1,林煥然1

(1.廣州大學 電子與通信工程學院, 廣東 廣州 510006;2.廣東白云學院 電氣與信息工程學院, 廣東 廣州 510450;

3.廣州大學 機械與電氣工程學院, 廣東 廣州 510006)


微信圖片_20210517164139.jpg

此內(nèi)容為AET網(wǎng)站原創(chuàng),未經(jīng)授權(quán)禁止轉(zhuǎn)載。