Image Tracking using AR.js - Problem with Custom Image Descriptors

有些话、适合烂在心里 提交于 2020-06-17 16:19:44

问题


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:

"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.

Here is my code 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>

Here is my folder structure:

src 
  | -- image_descriptors
         | -- test.fset
         | -- test.fset3
         | -- test.iset
  | -- assets
         | -- aframe-ar.html

回答1:


I test it using XAMPP. I don't know why but if you see the console, there is log

base path: http://localhost:8080

So i tried

<a-nft
    type="nft"
    url="test/image_descriptors/test"
    smooth="true"
    smoothCount="10"
    smoothTolerance=".01"
    smoothThreshold="5">

with this folder structure:

htdocs (basically http://localhost:8080)
| -- test
     | -- image_descriptors
          | -- test.fset
          | -- test.fset3
          | -- test.iset
     | -- assets
          | -- aframe-ar.html

and it works



来源:https://stackoverflow.com/questions/61078518/image-tracking-using-ar-js-problem-with-custom-image-descriptors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!