ARKit internal differences between portrait and landscape?

I do marker tracking for ARKit using OpenCV (using ARUCO), and I see good results with the portrait orientation of the camera, but a slight displacement in the landscape.

ARUCO markers at known positions:

ARUCo template

Detection in portrait mode:

Portrait Markers

In landscape orientation, the detection shows an offset:

Landscape Markers

Details what I am doing:

  • For each ARFrame do the following:
  • Get CVPixelBuffer height, width, baseaddress and convert to cv::Mat
  • Perform marker validation and position evaluation ( cv::aruco::detectMarkers , cv::aruco::estimatePoseSingleMarkers ) using the built-in ARFrame value.
    • The inner should be transposed for the main ARKit column in the OpenCV main row matrix store.
    • OpenCV rvec and tvec converted to a 4x4 transform using cv::Rodrigues , and then converted from OpenCV to the OpenGL coordinate space on diag(1,-1,-1,1) * transform
    • The result is converted back from the row to the main column and is the conversion of the marker into camera space.
  • Multiplying a transform with an ARCameras transform gives the marker plane in world coordinates, which I represent as a green rectangle.

My questions:

  • Did I miss something?
  • Should frame.displayTransform play any part of the transform?
  • Why does turning the device cause an internal change? The width and height of the pixel buffer do not change.
  • Any other ideas?

Update 07.25.2017:

  • I get it! This is a mistake from Apple! They messed up the insides between the UIInterfaceOrientation.landscapeLeft and landscapeRight. If you cache these values โ€‹โ€‹and change them, then everything works fine.
  • iOS 11 Beta 4 Changes Nothing
  • I keep this question open until resolved by Apple (bug ID 33519315 on the radar).

Update 09.14.2017:

  • Apple closed the error by saying that everything is correct. I'm not sure if they are correct, but potentially this is really a problem between OpenCV and ARKit.
+7
ios opencv augmented-reality arkit
source share

No one has answered this question yet.

See related questions:

1818
What is the difference between atomic and non-atomic attributes?
1300
Transferring data between view controllers
87
Augmented Reality SDK with OpenCV
4
Estimating camera position using opencv C ++, SolvePnP function
2
How to get the difference between the Aruco Markers angel axis in world coordinate?
0
Manual Raytrace for ARKit
0
3d object overlay - augmented reality irrlicht + opencv
0
using aruco to estimate the world position of the camera
0
ROS skeleton_tracking + multiple cameras + aruco
0
How to detect camera rotation in world space (rather than Charuco board orientation) in OpenCV?

All Articles