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. Problems faced in implementing signal and slot mechanism for camera program
QtWS25 Last Chance

Problems faced in implementing signal and slot mechanism for camera program

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 731 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.
  • K Offline
    K Offline
    Kira
    wrote on 28 Mar 2018, 05:10 last edited by
    #1

    Hello All,

    I have implement signal and slot mechanism for fetching the frame from camera and display it using opencv.
    The signal to slot connection is as follows:
    connect(cameraTimer, SIGNAL(timeout()), this, SLOT(showCameraFrame()));
    The timeout have been set to 1 millisec as : cameraTimer->start(1)

    showCameraFrame()--> capture the frame using VideoCapture class of opencv and display the latest frame on qlabel.

    Following were the observation:
    -> It takes a lot of time to process the other signal and also capturing of the frame.
    For ex: My signals of the serial port takes about 90-100 millisec to send data and get the response.
    In normal case it takes 0.2 nanosec.
    ->cap >> frame takes about 13 millisec. But normally take
    Note: cap is object of class VideoCapture & frame of class Mat of opencv.

    Solution: Decreasing the timeout time of the timer ie: timer->start(50) resolves the issue. The time to process the serial data and capturing of frame reduces the time to nanosec which is required.

    Please let know the exact issue of problem also i have tried to capture the frame using threading but there also frame was taking about 13 millisec which is also not desirable

    J 1 Reply Last reply 28 Mar 2018, 06:16
    0
    • K Kira
      28 Mar 2018, 05:10

      Hello All,

      I have implement signal and slot mechanism for fetching the frame from camera and display it using opencv.
      The signal to slot connection is as follows:
      connect(cameraTimer, SIGNAL(timeout()), this, SLOT(showCameraFrame()));
      The timeout have been set to 1 millisec as : cameraTimer->start(1)

      showCameraFrame()--> capture the frame using VideoCapture class of opencv and display the latest frame on qlabel.

      Following were the observation:
      -> It takes a lot of time to process the other signal and also capturing of the frame.
      For ex: My signals of the serial port takes about 90-100 millisec to send data and get the response.
      In normal case it takes 0.2 nanosec.
      ->cap >> frame takes about 13 millisec. But normally take
      Note: cap is object of class VideoCapture & frame of class Mat of opencv.

      Solution: Decreasing the timeout time of the timer ie: timer->start(50) resolves the issue. The time to process the serial data and capturing of frame reduces the time to nanosec which is required.

      Please let know the exact issue of problem also i have tried to capture the frame using threading but there also frame was taking about 13 millisec which is also not desirable

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 28 Mar 2018, 06:16 last edited by
      #2

      @Kira 1ms timeout would mean 1000 frames per second! What would be the reason to read frames at that speed? Do you have a high speed camera? Normal cameras have framerates between 24-60 frames per second...

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

      K 1 Reply Last reply 28 Mar 2018, 06:26
      2
      • J jsulm
        28 Mar 2018, 06:16

        @Kira 1ms timeout would mean 1000 frames per second! What would be the reason to read frames at that speed? Do you have a high speed camera? Normal cameras have framerates between 24-60 frames per second...

        K Offline
        K Offline
        Kira
        wrote on 28 Mar 2018, 06:26 last edited by
        #3

        @jsulm : Thanks a lot for the reply. Actually I have a camera which runs at 120fps.
        And what could be the probable reason for 13 millisec in capturing the frame. Maybe because i am requesting the frame so fast and camera is not being able to buffer and send the images when requested ??

        J 1 Reply Last reply 28 Mar 2018, 06:29
        1
        • K Kira
          28 Mar 2018, 06:26

          @jsulm : Thanks a lot for the reply. Actually I have a camera which runs at 120fps.
          And what could be the probable reason for 13 millisec in capturing the frame. Maybe because i am requesting the frame so fast and camera is not being able to buffer and send the images when requested ??

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 28 Mar 2018, 06:29 last edited by
          #4

          @Kira I don't know how you access the camera. Is there a possibility to get a notification from the camera if a new frame is available? This way you don't need to actively ask the camera.

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

          K 1 Reply Last reply 28 Mar 2018, 06:37
          2
          • J jsulm
            28 Mar 2018, 06:29

            @Kira I don't know how you access the camera. Is there a possibility to get a notification from the camera if a new frame is available? This way you don't need to actively ask the camera.

            K Offline
            K Offline
            Kira
            wrote on 28 Mar 2018, 06:37 last edited by
            #5

            @jsulm : I'll have to see to it . I was earlier using opencv. I have the camera sdk now so will try to get deeper to the features provide. Will let know in case if i get anything.

            Once again thanks for your help :)

            1 Reply Last reply
            1

            1/5

            28 Mar 2018, 05:10

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved