Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Snap Picture Not Working
Qt 6.11 is out! See what's new in the release blog

Snap Picture Not Working

Scheduled Pinned Locked Moved Unsolved General and Desktop
15 Posts 4 Posters 5.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • TrayonT Trayon

    I looked around and read that "imageCapture->capture();" will only capture to a file (and filled up my picture directory). I haven't found any way to trigger a capture to buffer. Can anyone help?

    JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by
    #6

    @Trayon
    http://doc.qt.io/qt-5/qcameraimagecapture.html#CaptureDestination-enum

    ?

    1 Reply Last reply
    0
    • TrayonT Offline
      TrayonT Offline
      Trayon
      wrote on last edited by
      #7

      My code set that value already. You can see it in the last function definition 'on_SnapButton_clicked()'

      1 Reply Last reply
      0
      • TrayonT Offline
        TrayonT Offline
        Trayon
        wrote on last edited by
        #8

        Actually, inspired by your post, I looked at isCaptureDestinationSupported. Apparently a buffer is not supported... Does anyone know why this could be?

        1 Reply Last reply
        0
        • mranger90M Offline
          mranger90M Offline
          mranger90
          wrote on last edited by
          #9

          Did you try connecting the imageCaptured signal (forgive the old syntax) ?

          connect(m_pImageCapture, SIGNAL(imageCaptured(int,QImage)), this, SLOT(processCapturedImage(int,QImage)));
          

          Then the slot:
          void xxxxx::processCapturedImage(int requestId, const QImage& img)

          You can extract from the QImage passed to the slot.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #10

            Since you want to send it to a REST service, why not exploit the fact that having that temporary file allows you to retry a failed upload without clogging the memory used by your application. You can delete the file once you're done with it.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • TrayonT Offline
              TrayonT Offline
              Trayon
              wrote on last edited by
              #11

              I looked into using the QImage, but I would either have to convert it to a QVideoFrame (and I couldn't find how), or perform a tedious manual conversion. I'd rather find out why the buffer option isn't supported and fix it rather than hack my way around. I'm going to try on my Linux machine with a spare webacam I found and see if that works.

              @SGaist
              I don't see why a temporary image would fare better than a buffer. I would have to read the file and re-fill my buffer if it fails, resulting in more time lost.

              1 Reply Last reply
              0
              • TrayonT Offline
                TrayonT Offline
                Trayon
                wrote on last edited by
                #12

                Apparently it works on Linux but not Windows. Anybody have some insight as to why?

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #13

                  Because the windows platform camera plugin doesn't implement that option.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • TrayonT Offline
                    TrayonT Offline
                    Trayon
                    wrote on last edited by
                    #14

                    Is there a file I can download that implements it for Windows, or is this a problem of QT having to get around to it?

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #15

                      If there was, it would be part of the plugin. See the DSCameraSession class.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved