使用AR.js进行图像跟踪-自定义图像描述符存在问题 [英] Image Tracking using AR.js - Problem with Custom Image Descriptors
问题描述
我正在尝试根据 demo 中提供的示例URL时,它可以工作,但是当我将URL指定为本地计算机中我自己生成的图像描述符的路径,出现此错误:
I am trying to generate an AR scene using Image Tracking based on the tutorial in AR.js documentation. When I was using the sample URL as provided in the demo in Codepen, it worked but when I specified the URL to be the path to my own generated image descriptors in my local machine, I got this error:
在Worker 404上加载标记时出错"
"Error in loading marker on Worker 404"
由于使用演示中提供的图像描述符时效果很好,因此我认为这与我生成的图像描述符有关,实际上我使用的是相同的
Since it was working well when I used the image descriptors provided in the demo, I assume it's something to do with the image descriptors that I generated, I am actually using the same image provided in the demo too so I don't think the problem is with the quality of the marker.
这是我的代码aframe-ar.html
:
<a-scene
vr-mode-ui="enabled: false;"
renderer="logarithmicDepthBuffer: true;"
embedded
arjs="trackingMethod: best; sourceType: webcam;debugUIEnabled: false;"
>
<a-nft
type="nft"
url="../image_descriptors/test"
smooth="true"
smoothCount="10"
smoothTolerance=".01"
smoothThreshold="5"
>
<a-entity
gltf-model='https://arjs-cors-proxy.herokuapp.com/https://raw.githack.com/AR-js-org/AR.js/master/aframe/examples/image-tracking/nft/trex/scene.gltf'
scale="5 5 5"
position="100 100 0"
>
</a-entity>
</a-nft>
<!-- static camera that moves according to the device movemenents -->
<a-entity camera></a-entity>
</a-scene>
这是我的文件夹结构:
src
| -- image_descriptors
| -- test.fset
| -- test.fset3
| -- test.iset
| -- assets
| -- aframe-ar.html
推荐答案
我使用XAMPP对其进行了测试.我不知道为什么,但是如果您看到控制台,则会显示日志
I test it using XAMPP. I don't know why but if you see the console, there is log
基本路径: http://localhost:8080
所以我尝试了
<a-nft
type="nft"
url="test/image_descriptors/test"
smooth="true"
smoothCount="10"
smoothTolerance=".01"
smoothThreshold="5">
具有以下文件夹结构:
htdocs (basically http://localhost:8080)
| -- test
| -- image_descriptors
| -- test.fset
| -- test.fset3
| -- test.iset
| -- assets
| -- aframe-ar.html
它有效
这篇关于使用AR.js进行图像跟踪-自定义图像描述符存在问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!