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. How can I display live camera feed?
Qt 6.11 is out! See what's new in the release blog

How can I display live camera feed?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.5k 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.
  • P Offline
    P Offline
    prerna1
    wrote on last edited by
    #1

    As of now, I am doing the following:

    1. I have cv::Mat image (from OpenCV) that I convert to a QImage dispQImage
    2. Then, each time I get a new frame, I do the following:
      QLabel *imgDispLabel = new QLabel("");
      imgDispLabel->setPixmap(QPixmap::fromImage(dispQImage));
      imgDispLabel->adjustSize();
      dockwidget->setWidget(imgDispLabel);

    This seems to be slow & not a very good way of doing it. Is there a better alternative that I can use?

    EDIT:
    I am already CV thing in a worker thread and passing the QImage through the signal. It does improve the performance, but I would like a better way to display the color frame, rather than creating a new label each time.

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Hi, I also worked with the CV lib, and no it's not Qt that slows the framing down. The CV math is very very demanding on your CPU time. The think you could do is place the CV in a different thread and the display of picture in an other. Use the signal/slot to pass data between both threads.
      That should speed up your GUI end.
      You could test how long the CV takes first, to verify my option.
      Greetz

      Greetz, Jeroen

      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