问题描述
无论我从https://github.com/nicolocarpignoli/artoolkit-barcode-markers-collection选择哪个集合(似乎是标记的规范集合),AR.JS中的条形码标记都得到不一致的结果。在同一集合中,即使所有的matrixCodeType都相同,某些标记也可以起作用,而有些则不起作用。我希望所有工作或所有工作都不在集合中。有什么想法为什么会有不一致的结果吗?
<!DOCTYPE html>
<html>
<head>
<Meta name="viewport" content="width=device-width,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0">
<script src="https://aframe.io/releases/1.0.0/aframe.min.js"></script>
<script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
</head>
<body style="margin:0px; overflow:hidden;">
<a-scene embedded arjs="debugUIEnabled:false; detectionMode:mono_and_matrix; matrixCodeType:4x4_BCH_13_9_3;" vr-mode-ui="enabled:false">
<a-assets>
<img id="station_01" src="assets/images/station_01.jpg">
<img id="station_02" src="assets/images/station_02.jpg">
<img id="station_03" src="assets/images/station_03.jpg">
</a-assets>
<a-marker-camera type="barcode" value="1">
<a-image src="#station_01" scale="2 3 1" rotation="-90 0 0"></a-image>
</a-marker-camera>
<a-marker-camera type="barcode" value="2">
<a-image src="#station_02" scale="2 3 1" rotation="-90 0 0"></a-image>
</a-marker-camera>
<a-marker-camera type="barcode" value="3">
<a-image src="#station_03" scale="2 3 1" rotation="-90 0 0"></a-image>
</a-marker-camera>
<a-entity camera></a-entity>
</a-scene>
</body>
</html>
解决方法
我最近也在为同样的问题苦苦挣扎,就我而言,事实证明这是由于光照条件造成的。不均匀或不良的照明有时会产生阴影和对比度差异,这些差异似乎与肉眼无关,但会干扰模式识别和跟踪。