Using ARKit to capture high quality photos
I am interested in using ARKit's ability to track the phone's position to automatically take photos using the camera. My initial investigation led to me to understand that while ARKit is using the camera, it is not possible to get high-quality images using the standard AVFoundation methods (due to the camera being in use).
I understand I can use sceneView.snapshot()
, but the best quality this can provide is 1080p, which isn't high enough quality to use for my application.
My question is, are there any other methods for capturing a high-quality photo from the back-facing camera while an ARSession is running? If not, are there any alternatives to ARKit for estimating the position of the phone?
ios swift augmented-reality arkit
add a comment |
I am interested in using ARKit's ability to track the phone's position to automatically take photos using the camera. My initial investigation led to me to understand that while ARKit is using the camera, it is not possible to get high-quality images using the standard AVFoundation methods (due to the camera being in use).
I understand I can use sceneView.snapshot()
, but the best quality this can provide is 1080p, which isn't high enough quality to use for my application.
My question is, are there any other methods for capturing a high-quality photo from the back-facing camera while an ARSession is running? If not, are there any alternatives to ARKit for estimating the position of the phone?
ios swift augmented-reality arkit
Have you tried pausing the AR session, taking the photo, and resuming the session? It might not be instant, but you would get a high res photo.
– EmilioPelaez
Nov 15 '18 at 19:36
add a comment |
I am interested in using ARKit's ability to track the phone's position to automatically take photos using the camera. My initial investigation led to me to understand that while ARKit is using the camera, it is not possible to get high-quality images using the standard AVFoundation methods (due to the camera being in use).
I understand I can use sceneView.snapshot()
, but the best quality this can provide is 1080p, which isn't high enough quality to use for my application.
My question is, are there any other methods for capturing a high-quality photo from the back-facing camera while an ARSession is running? If not, are there any alternatives to ARKit for estimating the position of the phone?
ios swift augmented-reality arkit
I am interested in using ARKit's ability to track the phone's position to automatically take photos using the camera. My initial investigation led to me to understand that while ARKit is using the camera, it is not possible to get high-quality images using the standard AVFoundation methods (due to the camera being in use).
I understand I can use sceneView.snapshot()
, but the best quality this can provide is 1080p, which isn't high enough quality to use for my application.
My question is, are there any other methods for capturing a high-quality photo from the back-facing camera while an ARSession is running? If not, are there any alternatives to ARKit for estimating the position of the phone?
ios swift augmented-reality arkit
ios swift augmented-reality arkit
edited Nov 17 '18 at 1:41
Jonathan Leffler
565k916771026
565k916771026
asked Nov 13 '18 at 18:50
nprof50nprof50
62
62
Have you tried pausing the AR session, taking the photo, and resuming the session? It might not be instant, but you would get a high res photo.
– EmilioPelaez
Nov 15 '18 at 19:36
add a comment |
Have you tried pausing the AR session, taking the photo, and resuming the session? It might not be instant, but you would get a high res photo.
– EmilioPelaez
Nov 15 '18 at 19:36
Have you tried pausing the AR session, taking the photo, and resuming the session? It might not be instant, but you would get a high res photo.
– EmilioPelaez
Nov 15 '18 at 19:36
Have you tried pausing the AR session, taking the photo, and resuming the session? It might not be instant, but you would get a high res photo.
– EmilioPelaez
Nov 15 '18 at 19:36
add a comment |
1 Answer
1
active
oldest
votes
This probably won't get you the resolution you're looking for, but I have noticed that using the currentFrame.capturedImage
property on the ARSession
yields a higher resolution image than sceneView.snapshot()
.
Here's an example using the debugger on my iPhone 7:
(lldb) po sceneView.snapshot()
<UIImage: 0x282331180>, {750, 1334}
(lldb) po UIImage(pixelBuffer: session.currentFrame.capturedImage)
▿ Optional<UIImage>
- some : <UIImage: 0x282331e30>, {1920, 1440}
The resolution will probably vary based on your hardware.
Another thing to check is if you're overriding the videoFormat
property of your ARConfiguration
. You can check which video formats are supported for your device with ARWorldTrackingConfiguration.supportedVideoFormats
.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287693%2fusing-arkit-to-capture-high-quality-photos%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This probably won't get you the resolution you're looking for, but I have noticed that using the currentFrame.capturedImage
property on the ARSession
yields a higher resolution image than sceneView.snapshot()
.
Here's an example using the debugger on my iPhone 7:
(lldb) po sceneView.snapshot()
<UIImage: 0x282331180>, {750, 1334}
(lldb) po UIImage(pixelBuffer: session.currentFrame.capturedImage)
▿ Optional<UIImage>
- some : <UIImage: 0x282331e30>, {1920, 1440}
The resolution will probably vary based on your hardware.
Another thing to check is if you're overriding the videoFormat
property of your ARConfiguration
. You can check which video formats are supported for your device with ARWorldTrackingConfiguration.supportedVideoFormats
.
add a comment |
This probably won't get you the resolution you're looking for, but I have noticed that using the currentFrame.capturedImage
property on the ARSession
yields a higher resolution image than sceneView.snapshot()
.
Here's an example using the debugger on my iPhone 7:
(lldb) po sceneView.snapshot()
<UIImage: 0x282331180>, {750, 1334}
(lldb) po UIImage(pixelBuffer: session.currentFrame.capturedImage)
▿ Optional<UIImage>
- some : <UIImage: 0x282331e30>, {1920, 1440}
The resolution will probably vary based on your hardware.
Another thing to check is if you're overriding the videoFormat
property of your ARConfiguration
. You can check which video formats are supported for your device with ARWorldTrackingConfiguration.supportedVideoFormats
.
add a comment |
This probably won't get you the resolution you're looking for, but I have noticed that using the currentFrame.capturedImage
property on the ARSession
yields a higher resolution image than sceneView.snapshot()
.
Here's an example using the debugger on my iPhone 7:
(lldb) po sceneView.snapshot()
<UIImage: 0x282331180>, {750, 1334}
(lldb) po UIImage(pixelBuffer: session.currentFrame.capturedImage)
▿ Optional<UIImage>
- some : <UIImage: 0x282331e30>, {1920, 1440}
The resolution will probably vary based on your hardware.
Another thing to check is if you're overriding the videoFormat
property of your ARConfiguration
. You can check which video formats are supported for your device with ARWorldTrackingConfiguration.supportedVideoFormats
.
This probably won't get you the resolution you're looking for, but I have noticed that using the currentFrame.capturedImage
property on the ARSession
yields a higher resolution image than sceneView.snapshot()
.
Here's an example using the debugger on my iPhone 7:
(lldb) po sceneView.snapshot()
<UIImage: 0x282331180>, {750, 1334}
(lldb) po UIImage(pixelBuffer: session.currentFrame.capturedImage)
▿ Optional<UIImage>
- some : <UIImage: 0x282331e30>, {1920, 1440}
The resolution will probably vary based on your hardware.
Another thing to check is if you're overriding the videoFormat
property of your ARConfiguration
. You can check which video formats are supported for your device with ARWorldTrackingConfiguration.supportedVideoFormats
.
answered Nov 15 '18 at 19:23
HarrisonHarrison
434
434
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287693%2fusing-arkit-to-capture-high-quality-photos%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have you tried pausing the AR session, taking the photo, and resuming the session? It might not be instant, but you would get a high res photo.
– EmilioPelaez
Nov 15 '18 at 19:36