Start a new topic

Automatic image scaling problem between different devices (globalScale = -1)

Dear WikiTude Team,

we have problems with the automatic scaling of your SDK (globalScale = -1) between different devices.

Our app (Android and iOs) places a photo of a building at the real GPS position
of the building and tries to match the photo to the reality as exact as possible.

This is your location based approach like your sample NativeDetailScreen.

Our workflow is:

we finetune the values of scale.x/y and translate.y until the photo matches the real building as exact as possible, on our reference device (Samsung Galaxy Tab S2 LTE 9.7).
Then we have to trust into your SDK to make the AR image look the same way on arbitrary Android and iOs devices (taking into accout the cameras HFOV, VFOV, display aspect ratio, resolution, camera sensor chip partial usage, ...) so that the photo matches the building similar good as it did on our reference device.

The problem is now, on other devices (especially Samsung smartphones) the scaling matches quite bad, the AR image is e.g.TWICE as big as it should be!
See the attached images:
1. image on the reference device, the image matches fine to the real building
2. image on an S6, the image size is twice as it should be!

I attached an excel file of our test, look at the "calculated ratio" of the 4 devices.
This should be around 0.9 to 1.1 if we want to allow a maximum error of +/- 10% in scaling,
but it is e.g. 2,03 for the Samsung smartphones, which is an error of +103% (twice image size as it should be) !

We have set globalScale to -1 to enable your automatic scaling between devices.
We have set the scalingfactor to 1 to disable your DBS, so distance based scaling can not be the problem.
We fixed the GPS coord (with GPS Emulator) of all devices to one point 54 meters away from the building, so again, distance based scaling can not be the problem.  
Here is a dump of the scene parameters:
"scene {"minScalingDistance":1,"maxScalingDistance":16384,"scalingFactor":1,"globalScale":-1,"cullingDistance":50000}"

Here some hints:

In your automatic scaling, did you take into account that the S5/S6 smartphones have a 4:3 camera chip, but the 16:9 display in WikiTude takes only a part of the chip?
Maybe you have to scale your calculation the same way.
Please note that the scaling factor of this is probably not simply = 16/9 divided by 4/3, but a formula like:
tan(fovSmall/2) = 16/9 / 1 and
tan(fovBig/2)  =  4/3 / 1

We prefer holding the device in landscape mode.
If we move the device to portatrit mode, this instantly introduces a visual scaling change of 10 percent on e.g. the S6 (your SDK recalculates its automatic scalings internally if it detects the orientation change)
But there should be NO change in the image size as the buiding's size does not change in the camera view if I turn the device!
This issue (landscape/portrait mode scaling error) is not critical to our app as we could force it to landscape mode, but this could give you a hint where the problem lies in your automatic scaling algorithm.

If your algorithm looks at the screen resolution height, maybe you have to subtract the height of top and bottom panels first? See the attached pictures, and the "yResolution WebView" in the excel file.

Or maybe you do, and this is wrong? Depends on how the camera stream is mapped exactly on the screen.

Now our questions:

  • Can you reproduce the problems we encounter?
  • Which scaling accuracy do you expect between devices using your automatic scaling (globalscale = -1) ? I guess a scaling error of +/- 10 percent between devices will look ok on the end user's devices.

Please help us in getting this issue under control, at least in landscape mode, as the current problems critically "break" our app.

It shall soon be released for Android and iOs.

Thanks in advance

(8.88 KB)

1 person has this problem

Dear Wikitude Team,

we have re-read your documentation about the globalScale = -1 parameter and Evas explanation about that at

Did we misunderstood in our post above that globalScale = -1 would take care of different devices so that our AR image has the same "vertical size in meters" to get a good matching between the AR image and the real building on arbitrary devices?
  • Does globalScale = -1 mean that the AR image has "the same size in centimeters" on each devices screen?

This would be fine for (for example) company logos to stay readable on all devices, but for our application this is killing the scaling, as we saw in our test (see my post above).

We now did a second test, leaving globalScale = 1. This made the scaling better: maybe just +/- 20% error in the scaling which is not good but better than the over 100% of our first test.

We understand that there is a scaling error between devices becaouse globalScale = 1 is optimized for the iPhone 5, your reference device. Devices with similar camera FOV, resolution, and aspect like the iPhone 5 will look fine. Devices with strongly different camera FOV, resolution will look worse.

But here we found another critical problem. We have a strong yOffset between devices, even if the scale is fine on the device (by "luck"). I attached 2 images:

1. on the S2 (our reference device we finetune parameters to have a good match between AR photo and real building in the camera view. The match is quite good

2. the htc nexus 9. The scale is quite fine (by luck) but there is a strange offsetY here: the image is shifted up´

We don't use the GPS altitude parameter, so this should not be the problem.
  • Can you reproduce the offsetY problem on any devices? We feel that we should base on globalScale = +1, not globalScale = -1, because your automaticScaling (globalScale = -1) is of no use to our application if we understood this parameter now right in this comment
  • Can you help us get the scaling between devices under control for our app?

Thanks in advance



Hi Manuel,

I'm sorry that you're not satisfied with our convenient scaling options.

I guess what you want to do is quite impossible with sensor based AR (if you really, really want to have an accurate overlay) because the sensor accuracy is not good enough. Our computer vision approaches of upcoming version should work much better.

The best advice I could give you right now is to calculate device specific height values yourself at runtime and set this height for the image drawable. Disable DBS by setting the same min and max values and give it a try.

Best regards,


Login or Signup to post a comment