DennisLiu1993 / Fastest_Image_Pattern_Matching

C++ implementation of a ScienceDirect paper "An accelerating cpu-based correlation-based image alignment for real-time automatic optical inspection"
BSD 2-Clause "Simplified" License
802 stars 197 forks source link

用亚像素的时候 程序会崩掉 请问亚像素是没开发好 还是我的使用方式不对 #14

Open rmx564354093 opened 2 years ago

DennisLiu1993 commented 2 years ago

我已經把UI關掉了,你怎麼開啟這功能的呢?

而且我重新開啟後也沒問題,測試圖發給我試試吧 image

rmx564354093 commented 2 years ago

1_tmpImg PCS-4-元件名-3

rmx564354093 commented 2 years ago

我是用你的代码跑的 把亚像素关掉就不会越界 开启亚像素就会有数组越界的地方

DennisLiu1993 commented 2 years ago

@rmx564354093 同步新代碼試試,先前提速的修改少考慮了亞像素的部分

rmx564354093 commented 2 years ago

用最新的代码 开启亚像素 没有崩溃现象了 但是亚像素是否开启 好像坐标没啥变化

DennisLiu1993 commented 2 years ago

因為只有3*3的中心能夠算出亞像素(如果根據下面這篇https://github.com/DennisLiu1993/Fastest_Image_Pattern_Matching/issues/2#issuecomment-1132395574

如果覺得我的理解有錯可以討論下

ujsyl commented 1 year ago

在亚像素估计函数内部有一句代码为 matS.at(iRow, 0) = (vec)[iMaxScoreIndex + (theta - 1)].vecResult[x + 1][y + 1]; theta是从0-2,这样的话iMaxScoreIndex 只能为1,要不然越界。我有不太明白的地方: 1.如果最佳匹配点是iMaxScoreIndex=0或者2,对应的x\y\angle是没有做亚像素计算的,这个怎么解 2.看了您提供的论文,theta的循环的步长是±deleta,您代码是1,这里的考量是什么 3.(vec)[iMaxScoreIndex + (theta - 1)].vecResult[x + 1][y + 1] 这句代码中,角度为何加上iMaxScoreIndex sir,也许我论文没看懂,帮忙解惑,谢谢