Using ARKit to capture high quality photos












1















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?










share|improve this question

























  • 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
















1















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?










share|improve this question

























  • 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














1












1








1








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?










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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



















  • 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












1 Answer
1






active

oldest

votes


















0














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.






share|improve this answer























    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
    });


    }
    });














    draft saved

    draft discarded


















    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









    0














    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.






    share|improve this answer




























      0














      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.






      share|improve this answer


























        0












        0








        0







        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.






        share|improve this answer













        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 15 '18 at 19:23









        HarrisonHarrison

        434




        434






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Full-time equivalent

            Bicuculline

            さくらももこ