ARCamera intrinsics changes with UI orientation

Hi,


I have noticed that, on my iPhone 7, the ARCamera intrinsics matrix changes over time during an AR session.

I can understand how autofocus affects the focal depth (thus the intrinsics matrix) depending on whether the scene you are looking at is close to the device or far from it.

However, the intrinsics also changes significantly when switching between portrait and landscape orientation, despite looking at exactly the same scene from exactly the same position.


I cannot find any reason why this happens.


I am using the camera intrinsics to cast a ray on my own "3d objects" (that are not anchors nor 3d objects from SceneKit), so I am using both the intrinsics and extrinsics matrices provided with the ARCamera to do directly the intersection computation.

The resulting intersection of the ray cast with my "3d object" looks correct when being in portrait mode.

However, there is a shift when being in landscape mode.

I can understand why, given the remark on the intrinsics done above.

However, this does not help me to solve properly the ray cast I want to do.


Note: this does not happen when running the same code on an iPad Pro. The intrinsics matrix is constant regardless of UI orientation.


Any clarification on why the intrinsics changes depending on UI orientation and what intrinsics I should use to solve my problem would be really welcome.


Cheers,


Pierre

Replies

[Edit] I'm revising my initial post to include more correct info


I'm experiencing the same problem and haven't been able to figure out a fix either. Based on your information, you have isolated it to the ARCamera intrinsics matrix. However, this does not seem to be the case from my observation. Here is what I see:


In my case, text and circles draw correctly in the device orientation I start out in, regardless of whether it is portrait or landscape. When I switch orientation, the text and circle becomes stretched (and skewed from some angles). Start in portrait, it is fine in portrait and skews in landscape. Start in landscapee, it is fine in landscape but skews in portrait.


I've looked at the starting ARCamera intrinsics matrix in both orientations on an iPhone (running iOS 11.1 Beta 4) and the matrix is the same when it starts in either portrait or landscape, so it doesn't seem that this could be the answer.


Have you made any progress on this, or does anyone have further insight on how to fix this?