Search Issue Tracker
Duplicate
Votes
0
Found in [Package]
1.0.19
Issue ID
1216994
Regression
No
Cannot retrieve photo location data (CamToWorld and Projection matrices) on HoloLens 2 via Unity.XR SDK
We are currently porting our HoloLens 1 application to support using HoloLens 2. The application has a 2D-Whiteboard which displays an image taken with the HoloLens RGB Camera via Unity.XR.WSA.WebCam.PhotoCapture (https://docs.microsoft.com/en-us/windows/mixed-reality/locatable-camera-in-unity). When taking the photo we save the location data (CamToWorld and Projection matrices) by calling:
photoCaptureFrame.TryGetCameraToWorldMatrix(out c2wMatrix);
photoCaptureFrame.TryGetProjectionMatrix(out projMatrix);
On HoloLens 1 everything works fine and we are using the matrices to project annotations (freehand drawings, circles, etc.) made on the 2D-Whiteboard into the 3D world to create spatial annotations.
Now, when using the same code compiled for ARM on HoloLens 2 we are not able to get location data. Calling photoCaptureFrame.TryGetCameraToWorldMatrix(out c2wMatrix) or photoCaptureFrame.TryGetProjectionMatrix(out projMatrix) always returns false and we are getting back identity matrices. For the moment we are stuck porting this functionality to HoloLens 2.
I have created a minimal Unity project with one script that takes a photo on HoloLens via Unity.XR.WSA.PhotoCapture SDK and attached it to reproduce this issue.
Steps to reproduce:
1. Open the attached Unity project and build "Sample Scene" for UWP for x86 and ARM
2. Build generated x86 project in Visual Studio and deploy on HoloLens 1 => see correct values in logged CamToWorldMatrix and ProjectionMatrix
3. Build generated ARM project in Visual Studio and deploy on HoloLens 2 => see wrong values in logged CamToWorldMatrix and ProjectionMatrix (identity matrix, because retrieving location data do not work)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
This is a duplicate of issue #1207427