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 to send camera frame to imagebox from thread
Forum Updated to NodeBB v4.3 + New Features

how to send camera frame to imagebox from thread

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 336 Views
  • 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.
  • Z Offline
    Z Offline
    Zelda4
    wrote on last edited by
    #1

    i have MainWindow and then i have another form which i call Table Manager which have table widget , to process the table data i have worker

    i move the worker to thread where it process data but this worker also turning ON the camera and would get frames from camera . so the problem is how i get back to MainWindow from this worker to update the camera stream on MainWindow

    here is flow

    MainWindow ( UI which have ImageBox of camera )
    |
    |
    V
    Table Manager form ( where i have few buttons to load files data into table)
    |
    |
    v
    WORKER ( moved to thread for backend processing)

    normally using signal slots i can send Qstring message from worker to MainWindow. but i tried to send OpenCV cv::VideoCapture vcap back to MainWindow through signals and slots as first i pass it to table manager and then from table manager form to MainWindow but had no success with it , got error

    QObject::connect: Cannot queue arguments of type 'cv::VideoCapture'
    (Make sure 'cv::VideoCapture' is registered using qRegisterMetaType().)
    

    so am wondering what could be good approach so that i can display camera video on MainWindo UI ImageBox and as well as my worker get frames / image from that camera video feed.

    thanks

    jsulmJ 1 Reply Last reply
    0
    • Z Zelda4

      i have MainWindow and then i have another form which i call Table Manager which have table widget , to process the table data i have worker

      i move the worker to thread where it process data but this worker also turning ON the camera and would get frames from camera . so the problem is how i get back to MainWindow from this worker to update the camera stream on MainWindow

      here is flow

      MainWindow ( UI which have ImageBox of camera )
      |
      |
      V
      Table Manager form ( where i have few buttons to load files data into table)
      |
      |
      v
      WORKER ( moved to thread for backend processing)

      normally using signal slots i can send Qstring message from worker to MainWindow. but i tried to send OpenCV cv::VideoCapture vcap back to MainWindow through signals and slots as first i pass it to table manager and then from table manager form to MainWindow but had no success with it , got error

      QObject::connect: Cannot queue arguments of type 'cv::VideoCapture'
      (Make sure 'cv::VideoCapture' is registered using qRegisterMetaType().)
      

      so am wondering what could be good approach so that i can display camera video on MainWindo UI ImageBox and as well as my worker get frames / image from that camera video feed.

      thanks

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Zelda4 You will need to register cv::VideoCapture with https://doc.qt.io/qt-5/qmetatype.html#qRegisterMetaType-1
      Or simply pass a pointer instead by-value (this could increase performance dramatically if cv::VideoCapture is big). But then you will need to care about life-time of cv::VideoCapture instance.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      Z 1 Reply Last reply
      2
      • jsulmJ jsulm

        @Zelda4 You will need to register cv::VideoCapture with https://doc.qt.io/qt-5/qmetatype.html#qRegisterMetaType-1
        Or simply pass a pointer instead by-value (this could increase performance dramatically if cv::VideoCapture is big). But then you will need to care about life-time of cv::VideoCapture instance.

        Z Offline
        Z Offline
        Zelda4
        wrote on last edited by
        #3

        @jsulm ok thanks i will try it and will update you :) . thanks

        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