使用AR.js扫描QR码并根据扫描值显示对象

时间:2022-10-23 15:26:19

In my web application, want to implement Augmented Reality with QR code scanned value.

在我的Web应用程序中,想要实现具有QR码扫描值的增强现实。

After QR code is scanned get data from the server based on QR code value and show image or objects based on the response.

扫描QR码后,根据QR码值从服务器获取数据,并根据响应显示图像或对象。

I have gone through A-Frame blog able to show sample objects with hiro/barcode but with static values. I want to make it dynamic by scanning QR code.

我已经通过A-Frame博客能够使用hiro /条形码显示样本对象,但具有静态值。我希望通过扫描QR码使其动态化。

How to achieve this by using AR.js and A-Frame?

如何通过使用AR.js和A-Frame实现这一目标?

1 个解决方案

#1


1  

This can be accomplished with data matrices. Configure your scene like this:

这可以用数据矩阵来完成。像这样配置你的场景:

<a-scene arjs='detectionMode: mono_and_matrix; matrixCodeType: 3x3;'></a-scene>

Then, wrap your object(s) in a barcode marker:

然后,将对象包裹在条形码标记中:

<a-marker type='barcode' value='5'></a-marker>

You can use this tool to generate your barcodes: http://au.gmented.com/app/marker/marker.php

您可以使用此工具生成条形码:http://au.gmented.com/app/marker/marker.php

Note that matrixCodeType can be one of:

请注意,matrixCodeType可以是以下之一:

[3x3, 3x3_HAMMING63, 3x3_PARITY65, 4x4, 4x4_BCH_13_9_3, 4x4_BCH_13_5_5]

Some of these will be able to encode a greater number of unique values, but they have varying levels of accuracy. You can read about that here: https://github.com/artoolkit/artoolkit-docs/blob/master/3_Marker_Training/marker_barcode.md

其中一些将能够编码更多数量的唯一值,但它们具有不同的准确度。你可以在这里阅读:https://github.com/artoolkit/artoolkit-docs/blob/master/3_Marker_Training/marker_barcode.md

#1


1  

This can be accomplished with data matrices. Configure your scene like this:

这可以用数据矩阵来完成。像这样配置你的场景:

<a-scene arjs='detectionMode: mono_and_matrix; matrixCodeType: 3x3;'></a-scene>

Then, wrap your object(s) in a barcode marker:

然后,将对象包裹在条形码标记中:

<a-marker type='barcode' value='5'></a-marker>

You can use this tool to generate your barcodes: http://au.gmented.com/app/marker/marker.php

您可以使用此工具生成条形码:http://au.gmented.com/app/marker/marker.php

Note that matrixCodeType can be one of:

请注意,matrixCodeType可以是以下之一:

[3x3, 3x3_HAMMING63, 3x3_PARITY65, 4x4, 4x4_BCH_13_9_3, 4x4_BCH_13_5_5]

Some of these will be able to encode a greater number of unique values, but they have varying levels of accuracy. You can read about that here: https://github.com/artoolkit/artoolkit-docs/blob/master/3_Marker_Training/marker_barcode.md

其中一些将能够编码更多数量的唯一值,但它们具有不同的准确度。你可以在这里阅读:https://github.com/artoolkit/artoolkit-docs/blob/master/3_Marker_Training/marker_barcode.md