首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >简单Vuforia to HoloLens

简单Vuforia to HoloLens
EN

Stack Overflow用户
提问于 2017-02-17 04:22:09
回答 2查看 809关注 0票数 1

我正在尝试从HoloLens获取一个简单的Vuforia图像到一个将QRCodes转换为文本(通过ZXing)的函数。我导入了ZXing库,在阅读类似的实现时发现,下面的实现是它最简单的实现形式。

实际上非常简单,步骤包括

  1. 从设置条形码对象开始
  2. 初始化摄像机
  3. 将QRcode的文本值发送到控制台 使用UnityEngine;使用系统;使用System.Collections;使用UnityEngine.UI;使用Vuforia;使用ZXing;公共类HelloWorldV2 : MonoBehaviour { private bool cameraInitialized;private BarcodeReader barReader;void Start() { GameObject sometext = GameObject.Find(" Text ");Text txt = sometext.GetComponent();txt.text = "Right HERE“;barReader = new BarcodeReader();txt.text =”右转“;//永远不会到达这里!StartCoroutine( InitializeCamera() );}私有IEnumerator InitializeCamera(){ //等待一点似乎可以避免Vuforia的崩溃。返回新的WaitForSeconds(1.25f);var isFrameFormatSet =WaitForSeconds true;Debug.Log(String.Format("FormatSet:{0}",isFrameFormatSet));// Force自动聚焦。CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);if (! isAutoFocus ) { CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_NORMAL);}Debug.Log(String.Format(AutoFocus:{0},isAutoFocus));cameraInitialized = true;}私有void (){ if (cameraInitialized) { try { var cameraFeed =cameraInitialized if (cameraFeed == null) {cameraFeed;} var data = barReader.Decode(cameraFeed.Pixels,cameraFeed.BufferWidth,cameraFeed.BufferHeight,RGBLuminanceSource.BitmapFormat.RGB24);检测到if (data != null) { // QRCode。Debug.Log(data.Text);}Debug.Log(“未检测到QR代码!");} catch (异常e) { Debug.LogError(e.Message);}}}

因此,这个问题只是发生在构造函数调用BarcodeReader()上。我不知道这是怎么回事。为什么一个简单的构造函数调用会失败?

我从调试会话中得到的唯一其他提示是:

代码语言:javascript
复制
FileLoadException: Could not load file or assembly 'System.Core, 
Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of 
its dependencies. The located assembly's manifest definition does not match 
the assembly reference. (Exception from HRESULT: 0x80131040)
    at ZXing.BarcodeReader..ctor()
    at HelloWorldV2.Start()

有人能通过VisualStudio的模拟器复制这个问题吗?(请注意,当将FrameFormats替换为灰度时,这在Unity中起作用。

EN

回答 2

Stack Overflow用户

发布于 2017-03-02 15:01:55

基于这篇博客文章,我建立了一个用ZXing在HoloLens上扫描QR代码的工作解决方案:

https://mtaulty.com/2016/12/28/windows-10-uwp-qr-code-scanning-with-zxing-and-hololens/

票数 1
EN

Stack Overflow用户

发布于 2017-05-31 20:00:49

这是因为您使用了错误的dll文件(hololens不支持该文件)。尝试ZXing.net中的winmd文件

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42289346

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档