iT邦幫忙

0

機器視覺專家 請進 opencv中的透射投影問題 (實作MarkerLess AR)

我最近正在翻譯一本書的原始碼他是用C++寫的
主題是Marker less AR
我想使用keypoint來得到homography矩陣
使用homography矩陣 跟src [(0,0),(w,0),(w,h),(0,h)]
(W是Marker圖片 的寬度 H則是長度)
求得dst
圖片中紅色點是正確的位置 黑色點是我實際投影的位置
https://ithelp.ithome.com.tw/upload/images/20200912/20110028gIe7ysn3ac.png
他的GITHUB: https://github.com/MasteringOpenCV/code/tree/master/Chapter3_MarkerlessAR

由於我第一次接觸此概念 無法簡單的直接描述 所以我使用流程圖說明
https://ithelp.ithome.com.tw/upload/images/20200912/20110028hjkO7bWoZU.png

為了避免篇幅過長 所以 我將代碼放到github
https://github.com/abc225313/MarkerLessDetector
接下來會以字典的方式說明以及該Function的位置
若你聽不懂我說明的這裡有電子書在第三章
https://www.cs.ccu.edu.tw/~damon/photo/,OpenCV/,Mastering_OpenCV.pdf

(1)..單純的讀取Marker圖片 在Program.cs的main fuction
以及訓練 在PatternDetector.cs的
train (Pattern pattern)
buildPatternFromImage (Mat image, Pattern pattern)

(2) 讀取串流的圖片 在Program.cs的main fuction

(3)擷取串流圖片的特徵點,在PatternDetector.cs的
bool extractFeatures (Mat image,ref KeyPoint[] keypoints, ref Mat descriptors)

(4)特徵點匹配 在PatternDetector.cs的
void getMatches (Mat queryDescriptors, ref DMatch[] matches)

(5)FindHomography
在PatternDetector.cs的
static bool refineMatchesWithHomography(too much)
(6) PerspectiveTransform
在PatternDetector.cs的
static bool refineMatchesWithHomography(too much)

這是
Main function
https://ithelp.ithome.com.tw/upload/images/20200912/20110028QzsFo7iLrD.png

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答