更改ARToolkit中方形标记的默认边框粗细

时间:2018-01-08 03:48:46

标签: javascript artoolkit jsartoolkit

根据ARToolkit网站上的this指南,默认标记边框厚度为25%。我想将它改为20%,也可能是15%。有可能修改它吗?如果可能,那怎么样?

1 个答案:

答案 0 :(得分:2)

由于您没有指定语言,我假设您在C中使用ARToolKit。但更改边框宽度的功能也会暴露给Android和iOS。

- mk_patt can now train markers with non-standard border widths. The command line switch "-border=n" (n between 0 and 0.5 (not inclusive)) specifies the desired border width as a proportion of the marker width. The portion of the marker which will be used as the pattern is now indicated by mk_patt by outlining in blue. Note that in order to use markers with non-standard border widths, the border width must be specified in the application by using the arSetBorderSize() function (see reference documentation for more information.) (来源:https://github.com/artoolkit/artoolkit5/blob/47d5796eef841e11f54e6d7040f389063c05b5a3/ChangeLog.txt注意:不推荐使用arSetBorderSize(),而应使用arSetPatRatio()代替

以下是您需要使用的功能的定义: https://github.com/artoolkitx/artoolkit5/blob/47d5796eef841e11f54e6d7040f389063c05b5a3/include/AR/ar.h#L772

===编辑1:===

@Angelo Joseph Salvador现在指出他正在寻找JSARToolKit的解决方案,可以使用这个函数来完成https://github.com/artoolkitx/jsartoolkit5/blob/master/js/artoolkit.api.js#L929

在现有的ARController对象上。