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



根据ARToolkit网站上的本指南,默认标记边框厚度为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约瑟夫萨尔瓦多现在指定的那样,他正在寻找JSARToolKit的解决方案,可以使用此功能来完成 https://github.com/artoolkitx/jsartoolkit5/blob/master/js/artoolkit.api.js#L929

在现有的 ARController 对象上。

最新更新