Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8993083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:06:50+00:00 2026-06-15T23:06:50+00:00

I am having problem to implement the following scenario. My problem statement goes like

  • 0

I am having problem to implement the following scenario. My problem statement goes like this:

  1. I have 3 threads. ThreadCamera for grabbing frames from a camera. ThreadProcess for processing (doing some image processing with OpenCV on the image/frame grabbed) the frame and main GUI Thread for displaying the image.
  2. I don’t know how much time ThreadProcess will take to process an image. So I want to pass the image from ThreadCamera to ThreadProcess , do some image processing on the image and pass it to the main GUI Thread for display.
  3. When ThreadProcess processes the image the ThreadCamera should sleep. I.e. it should not grab further frames from the camera. When the ThreadProcess finishes the image processing task it should pass the image and some information to the main GUI Thread. After this only the ThreadCamera should wake up and grab the next frame/image from the camera runnig in that(ThreadCamera) thread.

Thanx Guys…after some comments to put Camera and Image Processing job in a single thread i would like to know another point..which is..

  1. What if don’t want to sleep the camera while the processing is going on?It does not matter to me if I loose some of the frames grabbed by CameraThread(which in any case I am loosing if i sleep or not sleep the camera)

I am using QObject for each process(Camera Process and Image Processing job) and movetoThread command to make it run in a particular thread.

Any insight about the implementation and signal/slot design will be helpful..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:06:51+00:00Added an answer on June 15, 2026 at 11:06 pm

    What you’re looking for is a simple “Publish/Subscribe” pattern. In this type of ‘distribution’ pattern, all messages are sent and just dropped by the client when it’s not in a state to receive images

    I would implement this as the following in your application:

    Have all separate threads (Camera,Processing,Gui) like you already do.

    Have the CameraThread peridocally (through a qTimer signal maybe if you want to make it simple) capture an image and sent it over a signal/slot connection to the processingThread.

    When the processingThread is processing an image, it sets a state flag (can just be a member variable, a bool would work) to say that its currently processing an image. When you’re done processing the image you set the flag to say that you’re not processing.

    In the processingThreads slot, which receives the images from the CameraThread, you will first check to see if you’re currently processing an image. If you are, you do not do anything with the signals data and you just return. If you are not processing an image, you will store the signals data and call the process function.

    The trick to making this work is to include this function call (QCoreApplication::processEvents()) in your ProcessingThreads main loop in the processing function. This will allow your ProcessingThread to process any signals it gets WHILE it’s doing something useful.

    The state variable checking will allow you to ‘drop’ all new images sent to you while you’re processing a current one and not queue them up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been having this annoying problem when trying to implement a picture gallery
Im having problem in my UIscrollView ,this is what I have done: Whenever a
In a game application I have the following scenario: From the main game Activity
I'm new to Java and I have come to having the following problem: I
I have been following the official Android tutorials and somehow am having a problem
I'm trying to implement a CSS menu and am having a problem with the
I am having problem to get a numerical value for this expression where I
I'm having problem with datagrid view. I have attached an image with the code
hello I am having problem related to https:// . I have used FB.getLoginStatus(function(response) function
I have implement a log4j.xml file having two loggers. Both EventLogger and ErrorLogger logged

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.