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

Change default border thickness of a square marker in ARToolkit

根据 ARToolkit 网站上的 this 指南,默认标记边框粗细为 25%。我想将其更改为 20%,也可能更改为 15%。可以修改吗?如果可以,那怎么做?

由于你没有指定语言我假设你在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 对象上。