1

tl;dr: Is there a way to get Cardboard's calibration data without parsing through Google's protocol buffers?
I need to access Cardboard viewer's lens data, coefficients etc. to do proper undistortion calculation. I contacted two Cardboard viewer manufactures and both had no idea what the values are and pointed me to contact google, since they used googles calibration. As discribed here you can decode the QR code by c++ parsing it through Google's protocol buffers, but I am currently not in a c++ dev enviroment and crunching through the doc to get the manufacturers calibration is very time consuming for just a bunch of coefficients. Is there a better way?

Community
  • 1
  • 1
FrostKiwi
  • 741
  • 1
  • 6
  • 16
  • FWIW, the Protocol Buffers format is supported by numerous other programming languages besides C++. – 500 - Internal Server Error Apr 23 '16 at 20:05
  • I had a hunch, that was the case, still, crunching a whole doc just to get the base64 encoded string is painful. Would make deving for cardboard outside the google eco system a whole lot easier. – FrostKiwi Apr 23 '16 at 20:18

2 Answers2

2

Someone build a Webpage (https://lisa-wolfgang.github.io/vrEmbed/tools/google_profile_decode.html) that decodes the Google Cardboard Links into JSON using googles javascript protocol buffer library. (If you use the short URL, leave out the http://)

I used it to get out the data for a project.

dagelf
  • 1,468
  • 1
  • 14
  • 25
unki2aut
  • 38
  • 6
2

The accepted answer didnt work for me so I scanned the QR code with a reader, got a short goo.gl URL.

I ran this through https://www.expandurl.net/ and got a longer link that just points to the app store to download Cardboard app like this: http://google.com/cardboard/app?p=ALONGSTRINGOFCHARACTERS

I just needed this to set my Unity project's Cardboard profile automatically so that the QR code doesnt have to be scanned on every device:

GvrCardboardHelpers.SetViewerProfile("http://google.com/cardboard/cfg?p=ALONGSTRINGOFCHARACTERS");

You can Base64 decode that long string of characters (the 'p' parameter) to get the coefficients, but it's encoded in a binary format.

Reverse engineering the Cardboard profile generator (https://vr.google.com/cardboard/viewerprofilegenerator/) may help decode exactly which variables are what, but unfortunately it seems broken currently.

Mikepote
  • 6,042
  • 3
  • 34
  • 38