augmented-realitybarcodeaframemarkerar.js

AR.js - Barcode Marker only detects markers with id=0


I'm currently working on a simple AR-WebApp using AR.js. I've tried using (4x4) barcode markers and it works absolutely fine with the barcode id=0. But in case of markers with id!=0, none gets detected.

Here's my code:

<a-scene embedded
         arjs="detectionMode: mono_and_matrix; matrixCodeType: 4x4;">
    <!-- marker id=0 -->
    <a-marker type="barcode" value="0">
        <a-sphere material="color: blue; opacity: 0.5" radius="0.25"></a-sphere>
    </a-marker>

    <!-- marker id=1 -->
    <a-marker type="barcode" value="1">
        <a-text value="Detected id:1"></a-text>
    </a-marker>

    <a-entity camera></a-entity>
</a-scene>

I'm using these markers from https://github.com/nicolocarpignoli/artoolkit-barcode-markers-collection:

Barcode Marker with id=0 and Barcode Marker with id=1


Solution

  • I used the wrong matrixCodeType. I'm using the 4x4_BCH_13_9_3 markers from https://github.com/nicolocarpignoli/artoolkit-barcode-markers-collection. Thus, it should be matrixCodeType: 4x4_BCH_13_9_3. It's working fine now :)