MarkerBasedARExample
MarkerBasedARExample copied to clipboard
Distance to the marker seems to be wrong
Hi, I am trying your example and everything works fine with the exception to the marker distance. I scan it from 30-40cm distance but it shows in the Unity around 5 meters away. It's rendered correctly but I would like to use distance value and it seems to be incorrect.
I looked at the estimatePosition method and solvePnP method but I don't have so much experience yet to debug the issue.
I tried the example on webcam and on my android phone (Pixel 2 XL).
Thanks, Jacek
https://github.com/EnoxSoftware/MarkerBasedARExample/blob/master/Assets/MarkerBasedARExample/MarkerBasedAR/MarkerDetector.cs#L101-L104 I think you probably need to change these parameters.(unity scale 1.0 = 1m)
MarkerBasedARExample is based on https://github.com/MasteringOpenCV/code/tree/master/Chapter2_iPhoneAR. Please refer to MasteringOpenCV for a detailed algorithm.