AR.js icon indicating copy to clipboard operation
AR.js copied to clipboard

<a-marker-camera> with type="barcode" does not work

Open MalteJosten opened this issue 5 years ago • 4 comments

Do you want to request a feature or report a bug? Bug

What is the current behavior? Whenever I scan a barcode marker with a <a-marker-camera> setting, the detection gets recognized but no entity gets displayed. Using a hiro marker with <a-marker-camera preset="hiro"> works just fine.

If the current behavior is a bug, please provide the steps to reproduce. I'm currently working with

<a-scene id="scene"
             embedded
             arjs="detectionMode: mono_and_matrix; matrixCodeType: 4x4_BCH_13_9_3; debugUIEnabled: false;">

        <a-marker-camera barcode_marker
                         id="marker"
                         type="barcode"
                         value="1">
            <a-box></a-box>
        </a-marker-camera>
    </a-scene>

and

var markerAlreadyDetected = false;

AFRAME.registerComponent('barcode_marker', {
    init: function () {
        const marker = document.querySelector('#marker');
        marker.addEventListener('markerFound', function () {
            
            console.log("Marker Already Detected:", markerAlreadyDetected);
            console.log("Marker:", marker.object3D.position);

            if (!markerAlreadyDetected) {
                markerAlreadyDetected = true;
                //displayEntity("#box");
                console.log("New marker has been detected.");
            } else {
                console.log("Already detected marker.");
            }
        });
    }
});

Please mention other relevant information such as the browser version, Operating System and Device Name Tested on Chrome Canary 70 Android and Chrome 81 Desktop Win10

What is the expected behavior? Entities inside <a-marker-camera>...</a-marker-camera> should get displayed after marker detection.

If this is a feature request, what is motivation or use case for changing the behavior?

MalteJosten avatar May 04 '20 10:05 MalteJosten

In theory it should works but I think <a-marker-camera> it is a bit buggy, if you can try to use <a-entity-camera> and <a-marker>. I can't look at this, because i have limited time now :cry:

kalwalt avatar May 20 '20 14:05 kalwalt

Hi I managed to reproduce @MalteJosten's issue (toggle video quality to 1080p or else it'd be blurry). I think I might be able to help. @kalwalt, can I look into this and submit a PR?

qwloh avatar Dec 27 '20 11:12 qwloh

The issue persists in 2021. Are there any fixes?

vctrs avatar Oct 29 '21 15:10 vctrs

2022, does anyone has a solution for this?

horvbalint avatar Apr 09 '22 11:04 horvbalint