【问题标题】:UWP IOT, How to access camera on board?, not usb cameraUWP IOT,如何访问车载摄像头?,而不是 USB 摄像头
【发布时间】:2016-05-17 06:57:58
【问题描述】:

我在访问 IOT 摄像头时遇到问题, 我尝试创建访问相机的简单代码,从该相机查看实时流。 它适用于 Windows-phone 10 && Windows 10。 但在 IOT 设备上尝试时出现错误,显示“未找到设备” 相机就像here in this link

这里是代码

private async Task StartPreviewAsync()
    {
        try
        {
            mediaCapture = new MediaCapture();
            var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
            var count = allVideoDevices.Count;

            System.Diagnostics.Debug.WriteLine(count+"Video Capture Device");
            await mediaCapture.InitializeAsync();
            PreviewControl.Source = mediaCapture;
            await mediaCapture.StartPreviewAsync();
        }
        catch (UnauthorizedAccessException)
        {
            // This will be thrown if the user denied access to the camera in privacy settings
            System.Diagnostics.Debug.WriteLine("The app was denied access to the camera");
        }
        catch (Exception)
        {
            System.Diagnostics.Debug.WriteLine("MediaCapture initialization failed.");
        }
    }
    //protected async override void OnNavigatedFrom(NavigationEventArgs e)
    //{
    //    await CleanupCameraAsync();
    //}
    protected async override void OnNavigatedTo(NavigationEventArgs e)
    {
        StartPreviewAsync();
       
    }

对我的问题有什么建议吗?

【问题讨论】:

    标签: uwp iot


    【解决方案1】:

    Windows 10 IoT 版目前支持Hardware Compatibility List 上的有限数量的设备(请参阅Cameras 部分)。不幸的是,如果您的相机未在此处列出,您将无法从您的 UWP 应用程序中使用它。据我所知,不支持树莓派原生摄像头。

    【讨论】:

      猜你喜欢
      • 2019-11-11
      • 1970-01-01
      • 2016-12-28
      • 2012-04-17
      • 2020-01-10
      • 1970-01-01
      • 1970-01-01
      • 2017-07-13
      • 2019-06-16
      相关资源
      最近更新 更多