C# 无法在部署的版本中设置Vuforia帧格式

C# 无法在部署的版本中设置Vuforia帧格式,c#,unity3d,qr-code,zxing,vuforia,C#,Unity3d,Qr Code,Zxing,Vuforia,我正在开发一个AR应用程序,使用Vuforia进行型号目标和Zxing进行二维码扫描。 我已经按照Vuforia页面上的描述设置了项目。虽然我处于播放模式,但一切正常,但一旦我构建了它,它就无法设置帧格式,尽管在构建时没有编译错误 我正在使用: 统一2018.4.8f1 Vuforia 8.3.8 .Net 4.7 我尝试了不同的帧格式,给了unity管理员许可,打开了病毒扫描程序 private IEnumerator camInitializing() {

我正在开发一个AR应用程序,使用
Vuforia
进行型号目标和
Zxing
进行二维码扫描。
我已经按照Vuforia页面上的描述设置了项目。虽然我处于播放模式,但一切正常,但一旦我构建了它,它就无法设置帧格式,尽管在构建时没有编译错误

我正在使用:

  • 统一2018.4.8f1
  • Vuforia 8.3.8
  • .Net 4.7
我尝试了不同的帧格式,给了unity管理员许可,打开了病毒扫描程序

        private IEnumerator camInitializing()
        {
            //Wait for vuforia to initialize
            yield return new WaitForSeconds(4);
            if (CameraDevice.Instance == null)
            {
                Debug.LogError("No Instance of Camera could be found");
            }
            Debug.LogError( CameraDevice.Instance.IsActive());

            availableFormat = PIXEL_FORMAT.RGBA8888;
            if (!CameraDevice.Instance.SetFrameFormat(PIXEL_FORMAT.RGBA8888,true))
            {
                availableFormat = PIXEL_FORMAT.RGB888;
                if (!CameraDevice.Instance.SetFrameFormat(PIXEL_FORMAT.RGB888,true))
                {
                    availableFormat = PIXEL_FORMAT.RGB565;
                    if (!CameraDevice.Instance.SetFrameFormat(PIXEL_FORMAT.RGB565, true))
                    {
                        availableFormat = PIXEL_FORMAT.GRAYSCALE;
                        if (!CameraDevice.Instance.SetFrameFormat(PIXEL_FORMAT.GRAYSCALE, true))
                        {
                            availableFormat = PIXEL_FORMAT.UNKNOWN_FORMAT;
                            Debug.LogError("Couldnt Initiate Camera Format");
                        }
                    }
                }
            }

            var isAutoFocus = CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
            if (!isAutoFocus)
            {
                CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_NORMAL);
            }

            Debug.Log("QR Scanner ready");

            _isInitialized = true;
            DecoderThread = new Thread(decode);
            DecoderThread.Name = "T0, _decoder";
            DecoderThread.Start();
            pauseThread = true;

        }
程序应该在几秒钟后启动并初始化帧格式,这样我就可以调用getCamerImage来获取要解码的图像。无法设置导致GetCameraImage中出错的帧格式。在visual Studio中构建解决方案时,我可以发现以下两个错误:

在中的0x773DFD82(KernelBase.dll)处引发异常 zXingVuforiaTest.exe:WinRT原始错误-0x80040111: “Windows.UI.WindowManagement.DisplayRegion”。 onecoreuap\drivers\mobilepc\sensors\convergence\api\winrt\public\internal\viewpositiontrackerinternal.h(94)\Windows.Devices.sensors.dll!1FE833ED: (调用方:1FE8240F)异常(11)tid(17f0)80040111类工厂kann angeforderte Klasse nicht liefern异常在中的0x773DFD82处引发 ZvuvuFuiTeaSt.EXE:微软C++异常:WIL::ReultExtExct 内存位置0x0C53CA78。在中的0x773DFD82处引发异常 ZvvvuFuiTeaSt.EXE:微软C++异常:[重新投掷]在内存中 位置0x00000000。 onecoreuap\drivers\mobilepc\sensors\convergence\api\winrt\public\internal\sensor.cpp(179)\Windows.Devices.sensors.dll!1FE7F4AC: (调用方:1FE7B61C)异常(12)tid(17f0)80070490元素nicht 格芬登。zXingVuforiaTest.exe中0x773DFD82处引发异常: 微软C++异常:WIL::RESULTExtExtExad在内存位置 0x0C53C0。zXingVuforiaTest.exe中0x773DFD82处引发异常: 微软C++异常:[重新投掷]在内存位置0x00亿。 onecoreuap\drivers\mobilepc\sensors\convergence\api\winrt\public\internal\sensorserver.cpp(46)\Windows.Devices.sensors.dll!1FE78581: (呼叫者:1FE7593F)返回HR(7)tid(17f0)80070490元件nicht 格芬登。线程0x48a8已退出,代码为0(0x0)。例外情况 在zXingVuforiaTest.exe中的0x773DFD82(KernelBase.dll)处引发:WinRT 发起错误-0x80040111: “Windows.UI.WindowManagement.DisplayRegion”。 onecoreuap\drivers\mobilepc\sensors\convergence\api\winrt\public\internal\viewpositiontrackerinternal.h(94)\Windows.Devices.sensors.dll!1FE833ED: (调用方:1FE8240F)异常(13)tid(17f0)80040111类工厂kann angeforderte Klasse nicht liefern异常在中的0x773DFD82处引发 ZvuvuFuiTeaSt.EXE:微软C++异常:WIL::ReultExtExct 内存位置0x0C53CA48。在中的0x773DFD82处引发异常 ZvvvuFuiTeaSt.EXE:微软C++异常:[重新投掷]在内存中 位置0x00000000。 onecoreuap\drivers\mobilepc\sensors\convergence\api\winrt\public\internal\sensor.cpp(179)\Windows.Devices.sensors.dll!1FE7F4AC: (调用方:1FE7B61C)异常(14)tid(17f0)80070490元素nicht 格芬登。zXingVuforiaTest.exe中0x773DFD82处引发异常: 微软C++异常:WIL::RESULTExtExtExad在内存位置 0x0C53C90。zXingVuforiaTest.exe中0x773DFD82处引发异常: 微软C++异常:[重新投掷]在内存位置0x00亿。 onecoreuap\drivers\mobilepc\sensors\convergence\api\winrt\public\internal\sensorserver.cpp(46)\Windows.Devices.sensors.dll!1FE78581: (呼叫者:1FE7593F)返回HR(8)tid(17f0)80070490元件nicht 格芬登。在中的0x773DFD82(KernelBase.dll)处引发异常 zXingVuforiaTest.exe:WinRT原始错误-0x80040111: “Windows.UI.WindowManagement.DisplayRegion”。 onecoreuap\drivers\mobilepc\sensors\convergence\api\winrt\public\internal\viewpositiontrackerinternal.h(94)\Windows.Devices.sensors.dll!1FE833ED: (调用方:1FE8240F)异常(15)tid(17f0)80040111类工厂kann angeforderte Klasse nicht liefern异常在中的0x773DFD82处引发 ZvuvuFuiTeaSt.EXE:微软C++异常:WIL::ReultExtExct 内存位置0x0C53CAB8。在中的0x773DFD82处引发异常 ZvvvuFuiTeaSt.EXE:微软C++异常:[重新投掷]在内存中 位置0x00000000。 onecoreuap\drivers\mobilepc\sensors\convergence\api\winrt\public\internal\sensor.cpp(179)\Windows.Devices.sensors.dll!1FE7F4AC: (调用方:1FE7B61C)异常(16)tid(17f0)80070490元素nicht 格芬登。zXingVuforiaTest.exe中0x773DFD82处引发异常: 微软C++异常:WIL::RESULTExtExtExad在内存位置 0x0C53CD00。zXingVuforiaTest.exe中0x773DFD82处引发异常: 微软C++异常:[重新投掷]在内存位置0x00亿。 onecoreuap\drivers\mobilepc\sensors\convergence\api\winrt\public\internal\sensorserver.cpp(46)\Windows.Devices.sensors.dll!1FE78581: (呼叫者:1FE7593F)返回HR(9)tid(17f0)80070490元件nicht 格芬登。无法设置帧格式


在一些本地Vuforia代码中:int32\u t returnValue=il2cppPInvokeFunc(\uuuuuuuuuuuu licenseKey0\u已封送它停止调试,因为某些访问被拒绝

通过将
RGBLuminanceSource.BitmapFormat
切换到所选
PIXEL\u格式的合适格式
并用
try catch
块包围
setFrameFormat
来解决它。

通过切换
RGBL>来解决它UmananceSource.BitmapFormat
到所选的
像素格式的合适格式,并用
try catch
块封装
setFrameFormat

“Ausnahme ausgelöst”这就是为什么将技术术语翻译成德语应该是非法的。是的,之后我将语言改成了更令人愉快的英语“Ausnahme ausgelöst”这就是为什么将技术术语翻译成德语应该是非法的。是的,在那之后我把语言改成了英语,更令人愉快