Log in or register to post comments

Help with GPS AR using Vuforia

September 25, 2015 - 10:24am #1

I'm trying to create a sort of GPS/compass/gyroscope AR application where I'd put various 3D objects on real-world GPS coordinates and have them appear at the right location on the screen (and the phone's camera feed along with it). The issue I'm having is that my GPS markers don't fall on the right locations, but only when viewing from some places (when viewing from other places they align perfectly). The reason I'm using Vuforia is to display the camera feed because Unity's native API (WebCamTexture) is really slow and has really bad FPS.

I already have a working way to convert GPS coordinates to Unity coordinates (from GPS to ECEF and in the end ENU), the camera rotates correctly using the gyroscope and the world orients correctly via the compass, so I think the problem is that Vuforia's camera feed does not seem to coincide with what Unity's camera displays. I'm also guessing this has something to do with FOV and the projection matrix, but I'm not really sure how to check and/or account for this. Also, if I'm correct, Vuforia has to enlarge the camera feed a bit so it fills the entire screen (without black bars in either side), so this might also affect the issue even more.

Can someone push me in the right direction and tell me what I'm doing wrong? Did anyone try to do anything similar?

Help with GPS AR using Vuforia

October 30, 2015 - 4:52am #5

schpinn wrote:

dm3d wrote:

Vuforia's video background dimensions are independent of the native dimensions of the device screen. Vuforia's dimensions are pre-configured for best performance and may vary from device to device. When the dimensions have different aspect ratios, the video background may appear zoomed as the image is scaled uniformally to fill the screen.

Is there any way to "synchronize" the video background with Unity's camera, or in another words, make them behave in exactly the same way? As I said, what I'm trying to accomplish is to overlay 3D objects in Unity over real-world objects (via GPS, compass and gyroscope),  but if the two "worlds" (and their two corresponding cameras - the phone camera and Unity's camera) are not 100% synchronized, the objects will not align.

Small sidenote, preview comment doesn't work, at least not for me (Win7/Firefox dev edition 43.0a2) - it erases your comment.

 

Hello you could help me with the combination of sensors? (GPS + gyro + magnetometer) or even (gyro + magnetometer)?

Help with GPS AR using Vuforia

October 14, 2015 - 12:34pm #4

You can try having your camera use same settings as ARCamera, but the video background is rendered to a plane (ARCamera->Camera->BackgroundPlane) which you can see in Unity PlayMode. Depending on the device dimensions and screen aspect ratio, the camera FOV may display only part of the entire feed. You can observe this better by changing the Game view layouts in PlayMode and seeing the area of the video texture that the FOV is including.

* Regarding the "Preview" button for thread comment, it is currently buggy for comments that have quoted text. That issue already has a bug ticket filed for it.

Help with GPS AR using Vuforia

September 30, 2015 - 1:47am #3

dm3d wrote:

schpinn wrote:

Also, if I'm correct, Vuforia has to enlarge the camera feed a bit so it fills the entire screen (without black bars in either side)

Vuforia's video background dimensions are independent of the native dimensions of the device screen. Vuforia's dimensions are pre-configured for best performance and may vary from device to device. When the dimensions have different aspect ratios, the video background may appear zoomed as the image is scaled uniformally to fill the screen.

Is there any way to "synchronize" the video background with Unity's camera, or in another words, make them behave in exactly the same way? As I said, what I'm trying to accomplish is to overlay 3D objects in Unity over real-world objects (via GPS, compass and gyroscope),  but if the two "worlds" (and their two corresponding cameras - the phone camera and Unity's camera) are not 100% synchronized, the objects will not align.

Small sidenote, preview comment doesn't work, at least not for me (Win7/Firefox dev edition 43.0a2) - it erases your comment.

Help with GPS AR using Vuforia

September 29, 2015 - 2:01pm #2

schpinn wrote:

Also, if I'm correct, Vuforia has to enlarge the camera feed a bit so it fills the entire screen (without black bars in either side)

Vuforia's video background dimensions are independent of the native dimensions of the device screen. Vuforia's dimensions are pre-configured for best performance and may vary from device to device. When the dimensions have different aspect ratios, the video background may appear zoomed as the image is scaled uniformally to fill the screen.

 

Log in or register to post comments