Important: Please read the Qt Code of Conduct -

Efficient way of visualizing camera images without copying data to a Qt datastructure

  • Hi,

    is there a way to visualize raw image data (argb) in a Qt Widget without copying them first into some Qt datastructure (like QImage). We want to draw them directly from the raw data pointer to a window. For QPainter, it seems to be necessary to copy the data to a Qt datastructure first. Because it is a cross plaform application, we don't want to use OpenGL.
    Avoiding any unnecessary operation is important for our application because we are using 8 cameras with 2MP and 100fps each and want to display at least 30fps from each camera.

    Thank you in advance and best regards,

  • There is a constructor for image that can use the existing RGB array. No Data Copa will be done, thus it is very fast. See the image Dokumentation for details

  • ...No Data copy ...

  • Lifetime Qt Champion


    What kind of camera are they ?
    Out of curiosity, what are the reasons that make OpenGL not suitable ?

  • @Gerd thank you very much! Do you know what's the fastest way to draw the qimage in a widget?
    @SGaist we are using industrial "Matrix Vision" GigE cameras. About OpenGL: I am not 100% sure (just having my second week in a new company) but my collegue told me that the problem is that the application should work on windows and linux and you need a x server to run it on linux which they don't want to use.

  • Lifetime Qt Champion

    Then you should ask them what they want to use on Linux to show the application's GUI.
    It's likely going to be a challenge since you are new to the enterprise but an answer like "We don't want to use X11" is really not useful especially since there are other backends that can be used and that can exploit the GPU of the target without using X11. Also, if you are going to handle that many video streams in parallel, avoiding using hardware that is currently made for that kind of use case is a pretty bad idea to start with.

  • Hi,
    never did someting like displaying 8 pictures parallel. Most of my work uses only a single output.
    For a fast output in my ad-scanner i use SDL, its a bit tricky to use but very fast. With SDL you can also display your Images without creating QImages.
    I think its worth a try.

Log in to reply