Log in or register to post comments

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

February 11, 2016 - 1:59pm #1

From following the directions for integration Cardboard into AR/VR sample (and relevant to making from scratch), if I apply the change Vuforia.VuforiaBehaviour.Instance.ApplyCorrectedProjectionMatrix(proj, eye == Cardboard.Eye.Left); as specified, I end up with small (short) eye cameras.

If I remove that code, the size is much better (but not perfect), but I have an issue where the virtual objects seems to "float" around when I move around my head (the camera) instead of being stationary on the target. 

I looked up documentation and it specifically says NOT to use ApplyCorrectedProjectionMatrix for "see-through devices", which is defined as Google Cardboard. https://developer.vuforia.com/library/articles/Training/Vuforia-for-Digital-Eyewear.

Related to this issue here (looks the same):

https://stackoverflow.com/questions/32213408/google-cardboard-vuforia-camera-size-is-small

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

January 4, 2018 - 2:53am #23

I am still facing the small screen issue. I am using Unity 2017.3.0.f3 along with Vuforia 7.0.36.. Cannot find Vuforia.VuforiaBehaviour.Instance.ApplyCorrectedProjectionMatrix(proj, eye == Cardboard.Eye.Left);

 

I am using the Vuforia AR+VR sample from the asset store - https://www.assetstore.unity3d.com/en/#!/content/101547

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

October 11, 2016 - 5:06pm #22

I am also trying technique #1 from the integration tutorial and having the same result. Did you find a fix?

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

September 26, 2016 - 2:25am #21

i am using the Technique #1. of this guide:

https://library.vuforia.com/articles/Solution/Integrating-Cardboard-to-the-ARVR-Sample



and if i comment this code:

//                VuforiaBehaviour.Instance.ApplyCorrectedProjectionMatrix(mLeftCameraMatrixOriginal, true);

//                VuforiaBehaviour.Instance.ApplyCorrectedProjectionMatrix(mRightCameraMatrixOriginal, false);

in files: VrIntegrationHelper

NOTHING change....like you can see in the pic.



what can i do?

AttachmentSize
Image icon diomerdavuforia.png232.11 KB

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

June 20, 2016 - 12:48pm #20

I've been using modified version of the code below to scale the size up (I used 1.4f instead of 2.8) - try that out in CardboardEye.

 

gtsouza wrote:

I fix (scale) it on CardboardEye.cs

adding this yellow lines

zoom = 2.8f / Mathf.Lerp(1 / proj[1, 1], 1 / monoProj11, lerp) / proj[1, 1];
proj[0, 0] *= zoom;
proj[1, 1] *= zoom;

before

Vuforia.VuforiaBehaviour.Instance.ApplyCorrectedProjectionMatrix(proj, eye == Cardboard.Eye.Left);

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

June 19, 2016 - 12:53am #19

Did anyone find a solution for this? Having small screen whatever I do. Please share any solution you have.

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

March 17, 2016 - 3:22pm #18

AlessandroB wrote:

FYI:

Vuforia 5.5.9 has been released and it now supports Stereo AR/VR rendering with Cardboard Viewers, without requiring integration with the Cardboard SDK.

 

Additionally, Vuforia 5.5.9 provides support for METAL Graphics on iOS, Unity 5.3.2 and 5.3.3, see:

https://developer.vuforia.com/library/articles/Release_Notes/Vuforia-SDK-Release-Notes

https://developer.vuforia.com/downloads/sdk

Also, make sure to check the Unity Migration Guide before upgrading to Vuforia 5.5:

https://developer.vuforia.com/library/articles/Solution/Migrating-Unity-Projects-to-Vuforia-5-5

 

This change is also possible to perform it on the new vuforia update that does the SDK use of cardboard? Because they share the same problem of the small viewport ..

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

March 17, 2016 - 9:37am #17

This change is also possible to perform it on the new vuforia update that does the SDK use of cardboard? Because they share the same problem of the small viewport ..

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

March 11, 2016 - 2:03am #16

FYI:

Vuforia 5.5.9 has been released and it now supports Stereo AR/VR rendering with Cardboard Viewers, without requiring integration with the Cardboard SDK.

 

Additionally, Vuforia 5.5.9 provides support for METAL Graphics on iOS, Unity 5.3.2 and 5.3.3, see:

https://developer.vuforia.com/library/articles/Release_Notes/Vuforia-SDK-Release-Notes

https://developer.vuforia.com/downloads/sdk

Also, make sure to check the Unity Migration Guide before upgrading to Vuforia 5.5:

https://developer.vuforia.com/library/articles/Solution/Migrating-Unity-Projects-to-Vuforia-5-5

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

March 8, 2016 - 11:29am #15

Using 1.4 as the scaling factor, seems to work very well, no noticeable "curving" distortion of the camera. I believe the key is finding the scale where your max Width on the device before it starts getting cut off / distorted. I'll probably fine tune later, to something between 1.3 and 1.4, there is probably a better way to do this via code and using the camera's FOV aspect ratio, as this factor will probably vary slightly by device.

Edit: I should clarify that I modified the line zoom = 2.8f / Mathf.Lerp(1 / proj[1, 1], 1 / monoProj11, lerp) / proj[1, 1]; to be zoom = 1.4/ Mathf.Lerp(1 / proj[1, 1], 1 / monoProj11, lerp) / proj[1, 1];

 

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

March 4, 2016 - 9:09am #14

@parad0xchild, I notice exactly same thing here, let me know when you get less "zoom" result, maybe you can move around Z Axis, or Cameras FOV, etc,

Anyway, let me know :)

Thanks,

 

 

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

March 4, 2016 - 9:00am #13

@gtsouza

I got around to implementing the scaling you did, no real issues, but it does seem "too zoomed in" when wearing it. The phone cameras already default to a bit more zoomed in than your eyes expect (and don't have the proper FOV anyways), then with the cardboard "distoration" everything ends up a little warped (monitors become curved when they are flat). 

I'm going to try 2 things.

  1. Remove any distoration and see how it feels
  2. Using a different scale, due to the camera FOV being small it really shouldn't go to the top, but could still be improved from default.

 

AttachmentSize
Image icon Screenshot_2016-03-04-08-54-04.png402.87 KB

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

March 1, 2016 - 7:17pm #12

I haven't gone back to try the zoom myself yet, but that issue is common in my experience so far.

Basically just change the position of the reticle and rebuild, making sure it is in view from your camera in the preview. As far as I understand the reticle is trying to be accessed but it doesn't exist in current view for whatever reason (try modifying the reticle or the background plane while in "play").

The issue (most of the time) is more around Unity not properly cleaning up built files for some reason, same with the "view frustum", it usually fixes if you change some settings, run, change them back (forces to rebuild the assets). Also usually if you put a marker in view it'll display fine.

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

February 29, 2016 - 11:27pm #11

Thanks for your effort. After updating the code, getting new error from Rectile script.

here am attaching the screens also. please have a look. 

Thanks in Advance. 

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

February 29, 2016 - 10:56am #10

Hey,

Check my screenshot attached (follow it),

Thanks

AttachmentSize
Image icon LikeThat.PNG41.04 KB

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

February 28, 2016 - 11:46pm #9

@gtsouza,

I have added  the mentioned below yellow lines on CardboardEye.cs script.There is no change in screen size and still showing small screen.

 

Please have a look on attached Images.

 

Thanks In Advance! 

AttachmentSize
Image icon SmallScreen_Reference.png71.56 KB
Image icon CardboardEye_.png226.12 KB

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

February 26, 2016 - 11:25am #8

I fix (scale) it on CardboardEye.cs

adding this yellow lines

zoom = 2.8f / Mathf.Lerp(1 / proj[1, 1], 1 / monoProj11, lerp) / proj[1, 1];
proj[0, 0] *= zoom;
proj[1, 1] *= zoom;
 
before
 
Vuforia.VuforiaBehaviour.Instance.ApplyCorrectedProjectionMatrix(proj, eye == Cardboard.Eye.Left);

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

February 25, 2016 - 8:28am #7

Pretty much the exact same issue as below. The actual phone should have better fill than the Unity Preview (unity preview is using available FOV from your webcam).

Also make sure you're using the right "Cardboard Version", in the Cardboard Main (I believe) - there is 2014 and 2015, it makes a bit of difference. Otherwise yeah, the explaination below is why it's so small in comparison, and apparently the Vuforia code that handles it doesn't try to scale it up at all to best fit the available screen space (and that code isn't accessible to modify).

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

February 24, 2016 - 11:50pm #6

I have created a project with Unity5.3.0 with Vuforia 5-0-10 and cardboard v0.6.0.After following all the instructions, noticed that AR view in mobile is very small comparing with VR view. Here am attaching 2 screenshots. Please have a look and let me know did i done any wrong ?

Thanks in Advance!

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

February 18, 2016 - 12:34am #5

....by not using ApplyCorrectedProjectionMatrix, it still preserves the FOV of actual camera, but shows it to better fill the "eyes"....

yes, if you don't apply that method,  the background camera image is filling the eyes viewport; however, as you also observed, in order to make sure that the Augmentation (3D models) can match the "scaled up" video background image, you would need to scale the 3D objects up too;   this is however not something that can be done with a simple scaling of the objects, but you would need to change the camera projection matrix in such a way so that the FoV of the camera Frustum (i.e. the camera viewing volume in 3D space) would have to be somehow "shrinked" so to make the 3D object appear larger; 

this however would violate the Cardboard FoV amplitude (i.e. it would basically result in a reduction of the FoV angle (e.g. from 80 to about 60 degrees, for example) which is designed to work correctly with the cardboard lenses.

In a nutshell:

you need to use the ApplyCorrectedProjectionMatrix because this ensures that the augmentation is consistently registered with the video background image and at the same time preserving the Cardboard frustum FoV amplitude.

 

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

February 16, 2016 - 9:49am #4

Additional examples:

You can see from these examples that the AR objects / "projection" is scaled too small for the actual image, and thus "ApplyCorrected" scales it down to it, rather than up to the actual video coming in. The objects in "Not Corrected" are smaller than they should be, same as if I scaled up "CardboardHead" or something else.

Ideally I'd like a way to scale up the AR objects / layer, instead of scaling down the video background.

AttachmentSize
Image icon Not Corrected.png440.6 KB
Image icon Corrected.png203.85 KB

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

February 16, 2016 - 9:43am #3

I understand the FOV won't be as big as cardboard, and will reflect the actual camera - BUT by not using ApplyCorrectedProjectionMatrix, it still preserves the FOV of actual camera, but shows it to better fill the "eyes".

Pictures attached to show the difference. The size of the "NoApplyCorrected" is what I'm expecting to have, not the smaller in all dimensions "ApplyCorrected" view. If I scale up the "CardboardHead" or really anything else, I can get the video to be bigger, but the AR objects don't scale with it.

*The blue was to outline the default cardboard FOV / eyes

AttachmentSize
Image icon ApplyCorrected.png245.25 KB
Image icon NoApplyCorrected.png383.78 KB

ApplyCorrectedProjectionMatrix Issues - Small Screen (Cardboard)

February 15, 2016 - 3:55am #2

Cardboard uses a Field of View of about 80 degrees on each eye view;

Vuforia on the other hand sets its FoV to a smaller value, so that it matches (with good approximation) the real FoV of the device rear camera, so to ensure that the augmentation appears correctly regustered with the video background content. The camera FoV is typicall smaller than 80 degrees, usually it's in the range 50-60 degrees for most devices.

As such, the camera image will appear smaller than the available screen size, because the video background can only fill a subportion (e.g. 60 degrees) of the 80 degrees FoV of the Cardboard view;

also, the effect is usually more noticable in the vertical dimension, due to the aspect ratio of the device camera image.

So, this effect is excpected and normal;  if the camera image was filling the entire screen space, this would result in a distorted camera image.

Therefore, you need to use the ApplyCorrectedProjectionMatrix  method, as this ensures a correct rendering of the video background image within the cardboard left-right viewports, despite the smaller size of the image w.r.t. the screen.

 

Log in or register to post comments