开发AR应用,不仅需要三维投影方面的原创,也需要二维图像中位姿定位。
今天,我们只是实现了位姿定位功能,主要分两部分,一部分:生成标定物;第二部分:检测标定物,计算位姿。
生成标定物源码
- 参数设置
"{@outfile |a.jpg | Output image }"
"{w |1 | Number of markers in X direction }"
"{h |1 | Number of markers in Y direction }"
"{l |64 | Marker side length (in pixels) }"
"{s |1 | Separation between two consecutive markers in the grid (in pixels)}"
"{d |2 | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2,"
"DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, "
"DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12,"
"DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16}&