Qt Forum

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

    Forum Updated on Feb 6th

    Solved How to get Raw image frame data (RGB) from webcamera (Webcam)

    General and Desktop
    2
    2
    318
    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.
    • C
      cebuger last edited by

      Hi,
      Im doing a webstream demo application in desktop, hence I am using QT widgets (and not QML).
      I am learning on how to make QCamera work and I have made it work.

      Now I want to get the RGB image of the camera, so I can compress it using our own compression algorithm and send it to network using our own protocol.

      I want to do it explicitly as well so I can control the timing of capture (to prevent delay and timing issue).

      Most of the samples I see online is it captures image and dump to file.

      1. How can I do it? Capture the raw RGB image of the camera explicitly (manual triggered).
        Example
        rgbimage = capture()
        c = compress(rgb)
        sendToNetwork(c)
        rgbimage = capture();

      on the above pseudocode, i only capture the frame when processing is done so I can only capture fresh frame instead. That is the reason I want to manualy capture it instead of a callback trigger from the camera.

      Im using MediaWIdgets stuff like QCamera and QCameraViewFinder.
      I cant find a sample to do it, most captures and dump to a file.

      Thank you in advance!

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

        Hi and welcome to devnet,

        For that level of control, you will have to go lower level that what QCamera proposes. You also have to take into account that not all camera provides RGB data.

        In your case maybe OpenCV will be a better fit for that part of your code.

        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 2
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Hi and welcome to devnet,

          For that level of control, you will have to go lower level that what QCamera proposes. You also have to take into account that not all camera provides RGB data.

          In your case maybe OpenCV will be a better fit for that part of your code.

          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 2
          • First post
            Last post