qian256 / HoloLensARToolKit

Marker tracking using the front-facing camera of HoloLens (both 1 and 2) and Unity, with a wrapper of ARToolKit built for UWP (Windows Universal Platform)
GNU Lesser General Public License v3.0
349 stars 92 forks source link

How to tune "magicMatrix"? Can "CameraToWorldMatrix" be used instead? #34

Open ChrisVifzack opened 6 years ago

ChrisVifzack commented 6 years ago

Hello! Thank you for your work on bringing ARToolKit to HoloLens! I just downloaded and tested the sample unity project. It seems to work very well, except there is quite some offset between the marker location and the cube when looking through HoloLens. From reading the other issues, I think that this can probably be resolved by tuning the "magic function", right? Some questions regarding this: 1) What are the magicMatrix1 and magicMatrix2 doing? What transformations are these? I don't really know how to tune them, since I don't understand what they do? :/ 2) Also, if the magic function is taking care of the transformation between RGB camera and the virtual camera, wouldn't it be possible (and much easier) to use "CameraToWorldMatrix" from PhotoCapture class in UnityEngine.XR.WSA.WebCam API instead? (described here: https://docs.microsoft.com/en-us/windows/mixed-reality/locatable-camera) Or is this a different coordinate space tranformation?

I would very much appreciate your help with my questions! I'm kinda lost to solve the problem with the visual offset and don't know how to make it align...

yogihamdani commented 5 years ago

Hi, it has been discussed here :) https://github.com/qian256/HoloLensARToolKit/issues/17