A family of Microsoft self-contained, holographic devices that enable engagement with digital content and interaction with holograms in the surrounding environment.Miscellaneous topics that do not fit into specific categories.
To access the PV camera on HoloLens 2 using Unity, OpenXR, and MRTK3, follow these recommendations:
- Capabilities: Ensure that you have enabled the WebCam capability in your Unity UWP project settings. This is essential for accessing the camera.
- Runtime Permissions: In addition to enabling the WebCam capability, you may need to handle runtime permissions. On HoloLens 2, the user may be prompted to grant webcam permissions. This typically occurs the first time the app requests access. If the permission dialog does not appear, you may need to explicitly request access using the appropriate API calls.
- Using MediaCapture: It is recommended to use Windows.Media.Capture (MediaCapture) for accessing the PV camera. This approach provides more control and is compatible with UWP applications. You can initialize MediaCapture with the SharedMode property if you do not need exclusive control over the camera.
- Error Handling: If you encounter "Access denied" or "device not found" errors, verify that your app has the necessary permissions and that no other application is using the camera. Also, ensure that your app is running in a context where it can access the camera.
- Official Samples: Look for official Microsoft samples that demonstrate a working PV camera capture pipeline for HoloLens 2 with Unity and OpenXR. These samples can provide valuable insights and help you troubleshoot your implementation.
- Debugging: Utilize the Device Portal and Visual Studio output logs to gather more information about the errors you are encountering. This can help identify specific issues with your implementation.
By following these guidelines, you should be able to successfully access the PV camera for your computer-vision tasks on HoloLens 2.
References: