I'm researching whether it's fairly trivial to use custom lenses (like Moment wide lens) with ARKit. For that, I'd need to configure ARKit to use custom camera intrinsics for the specific lens. So far, I haven't found anything that suggests it's possible (neither ARCamera
not ARSession
provide interfaces for that). Is it safe to assume it's impossible with the current ARKit version?
Asked
Active
Viewed 313 times
-1

peetonn
- 2,942
- 4
- 32
- 49
-
What is the exact information that you are looking for? the focal length of the front camera? have you taken a look on this post: https://stackoverflow.com/questions/50281394/how-to-get-the-lens-position-on-arkit-1-5 You directly access the intrinsic matrix from the ARCamera – swiftlearneer Aug 20 '20 at 15:46
-
FOV mainly. I need to **set** it – peetonn Aug 20 '20 at 22:34
1 Answers
-1
In ARKit, you can directly access the intrinsic of the ARCamera:
func session(_ session: ARSession, didUpdate frame: ARFrame) {
guard let arCamera = session.currentFrame?.camera else { return }
//intrinsics: a matrix that converts between the 2D camera plane and 3D world coordinate space.
print("ARCamera Intrinsics = \(arCamera.intrinsics)")
}

swiftlearneer
- 324
- 4
- 17
-
-
Please take a look at this post:https://stackoverflow.com/questions/36280699/how-to-set-a-custom-views-intrinsic-content-size-in-swift – swiftlearneer Aug 21 '20 at 04:03
-
1what? this has no relation to the issue at all. I'm talking about having a custom lens mounted on the iPhone and adjusting ARKit framework so that it can work properly with distorted camera image. – peetonn Aug 25 '20 at 17:49