Closed sskadit closed 5 years ago
@sskadit : You should only be reporting bugs on AR.js here. Ask your question on Stackoverflow and I'll help you out.
@sskadit : You should only be reporting bugs on AR.js here. Ask your question on Stackoverflow and I'll help you out.
Thanks I have asked the stackover flow question
https://stackoverflow.com/questions/53260343/ar-js-marker-not-training-properly
Is there any image recognition like Vuforia capability with AR.JS @droid001
The trick is that the background should be rgb(240,240,240) and you should have an eye on the grid which is going to be produced. As you can see from the produced .patt file there are 16 values per row so if you have an image which is hitting that grid well then you're more likely to get a good recognition result.
Here's the svg I use as a template for markers:
Thanks for the help!! @droid001
@sskadit Not what I've seen while looking in the source code, but maybe someone on Gitter would know more about it.
use grey instead of white colors (with the black of course) and maybe I guess the image is too complex. try with another simplier image like the apple without the leaf. if it works, it's surely the 'too complicated' shape that your image has
I have the same problem. I am creating a extremly simple marker.
This is the pattern file
But currently it does not work. I am using the following code:
<!doctype HTML>
<html>
<script src="https://aframe.io/releases/0.8.0/aframe.min.js"></script>
<script src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.5.0/aframe/build/aframe-ar.js"> </script>
<script src="//cdn.rawgit.com/donmccurdy/aframe-extras/v4.2.0/dist/aframe-extras.min.js"></script>
<body style='margin : 0px; overflow: hidden;'>
<a-scene embedded arjs>
<a-assets>
<a-asset-item id="tree" src="bench.glb">
</a-assets>
<a-marker preset='custom' type='pattern' url='test.patt'>
<a-entity rotation="-90 0 0" material="shader: flat; color: red;" scale="0.01 0.01 0.01" gltf-model="#tree">
<a-animation attribute="rotation"
dur="10000"
fill="forwards"
to="0 360 0"
repeat="indefinite"></a-animation>
</a-entity>
</a-marker>
<a-entity camera></a-entity>
</a-scene>
</body>
</html>
@commentatorboy although it seems a simple image, this is not a 'simple marker'. try using only one of the letters, i.e. only the 'E' letter. to learn more about markers, please have a look here: https://medium.com/chialab-open-source/ar-js-the-simpliest-way-to-get-cross-browser-ar-on-the-web-8f670dd45462
I found out that if you use a pixelated text font it is more likely to work. I would recommend other people using pixelated text font too.
@nicolocarpignoli Thanks for the link.
Yes, problem was with the original image, 'too complex'. Nice to know this "pixeled text" thing. Thanks!
I close as solved
If I use this kind of image for the AR.JS Marker Training the Patt file is absolutely rubbish.
I have followed all the blogs like how to create a custom marker.
Tell me how could I get the perfect patt file where it can recognise the image properly.