EnoxSoftware / OpenCVForUnity

OpenCV for Unity (Untiy Asset Plugin)
https://assetstore.unity.com/packages/tools/integration/opencv-for-unity-21088
558 stars 175 forks source link

Any examples for AR Foundation? #117

Open burakkaraceylan opened 3 years ago

burakkaraceylan commented 3 years ago

I have a project where I use AR Foundation. Are there any examples for using solvepnp to place an object for augmented reality with AR Foundation?

EnoxSoftware commented 3 years ago

I found a code sample that converts ARFoundation's XRCameraImage to OpenCV's Mat and detecting ArUco marker here. https://gitlab.com/-/snippets/2041871

I haven't tried it, but it seems that developers can get the camera matrix from the TryGetIntrinsics method of ARCameraManager.

burakkaraceylan commented 3 years ago

Thank you I will try it.

Edit: I solved the problem.