OpenCVでのAR実装ライブラリArucoにおいてオリジナルのマーカー
(大げさに言えば、ネット上でそこらへんに転がっている画像を、コーナーを認識できるように加工したもの)
を認識させる方法はありますでしょうか?
https://gist.github.com/hauptmech/6b8ca2c05a3d935c97b1c75ec9ad85ff
python
1import numpy as np 2import cv2 3 4cap = cv2.VideoCapture(0) 5 6dictionary = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_4X4_50) 7#dictionary = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_ARUCO_ORIGINAL) 8 9while(True): 10 11 # Capture frame-by-frame 12 ret, frame = cap.read() 13 14 # Our operations on the frame come here 15 gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) 16 17 res = cv2.aruco.detectMarkers(gray,dictionary) 18 # print(res[0],res[1],len(res[2])) 19 20 if len(res[0]) > 0: 21 cv2.aruco.drawDetectedMarkers(gray,res[0],res[1]) 22 23 # Display the resulting frame 24 cv2.imshow('frame',gray) 25 if cv2.waitKey(1) & 0xFF == ord('q'): 26 break 27 28# When everything done, release the capture 29cap.release() 30cv2.destroyAllWindows()
こちらのコードは上記のURLを張り付けただけのものですが、読み取るマーカーもArUco内で生成可能な付属(されているものと言えばよいのでしょうか?)のものです。
この読み取るマーカーをオリジナルのものにしたいと考えているのですが、可能でしょうか?
【DICT_ARUCO_ORIGINAL】
ディクショナリの種類にこのようなものがありますが、リファレンスを覗くと
「standard ArUco Library Markers. 1024 markers, 5x5 bits, 0 minimum distance 」
このように書いてあるので、希望のマーカーにはなり得ないので質問させていただきました。
良い方法があれば是非ご教授お願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/12/06 09:18
2017/12/06 09:56
2017/12/06 10:21
2017/12/06 10:32
2017/12/06 10:33
2017/12/06 14:41