Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Trying to capture QImage of video frame

    General and Desktop
    5
    30
    14035
    Loading More Posts
    • 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.
    • SGaist
      SGaist Lifetime Qt Champion last edited by

      Please be more precise. "Not working" doesn't say much. What are you getting ? A blank image ? A black image ? Funny colours ?

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

      A 1 Reply Last reply Reply Quote 0
      • A
        Anjani @SGaist last edited by

        @SGaist
        ooh sorry for that. it still gives me .jpg image, where I want RGB data of image/frame.yet I am getting only the first frame all though I try to capture frame at any time.

        1 Reply Last reply Reply Quote 0
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Aren't you getting a .png file ?

          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 Reply Quote 0
          • A
            Anjani last edited by

            yes i am getting .png but i want data in rgb format. because raw data format is only allowed on my frame buffer to display.

            1 Reply Last reply Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              You do realise that if you load your image again in a QImage, you'll get a RGB image ?

              If you really want to save an RGB image then go for bitmap but beware, it's uncompressed.

              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 Reply Quote 0
              • A
                Anjani last edited by

                oh yes thank you. this will solve my problem partially. but what about new frame capture.? can you please help me out where I am lacking or what i am missing? why I am getting the same frame every time?If I'll get updated frame my task will be almost on final stage.please solve this.and again thank you.

                1 Reply Last reply Reply Quote 0
                • SGaist
                  SGaist Lifetime Qt Champion last edited by

                  You always take the same image from the list, check that your counter increments properly and that you indeed update the list.

                  On a side note, you should pass const reference to QImage parameters. That will save useless copies.

                  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 Reply Quote 0
                  • A
                    Anjani last edited by

                    Thank you for reply and sorry for late response. Yes probably i am incrementing the counter properly. and sir I couldn't understand what you said about const reference to QImage parameter?

                    1 Reply Last reply Reply Quote 0
                    • SGaist
                      SGaist Lifetime Qt Champion last edited by

                      Use: const QImage &image as parameter

                      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 Reply Quote 0
                      • A
                        Anjani last edited by

                        K let me try it

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post