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

  • Home
  • SEARCH
  • 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 920065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:38:53+00:00 2026-05-15T18:38:53+00:00

I have a Camera class that produces very large images at a high FPS

  • 0

I have a Camera class that produces very large images at a high FPS that require processing by a ImageProcessor class. I also have a WPF Control, my View, that displays this information. I need each of these components needs to run on it’s own thread so it doesn’t lock up the processing.

Method 1) Camera has an Action<Image> ImageCreated that ImageProcessor subscribes to. ImageProcessor has an Action<Image, Foo> ImageCreated that contains an altered Image and Foo results for the View to show.

Method 2) Camera has a threadsafe (using locks and monitors) ProducerConsumer to which it produces Images, and ImageProcessor waits and Consumes. Same story for the View.

Method 2 is nice because I can create and manage my own threads.

Method 1 is nice because I have have multiple ImageProcessors subscribed to the Camera class. But I’m not sure who’s thread is doing the heavyweight work, or if Action is wasting time creating threads. Again these images come in many times per second.

I’m trying to get the images to my View as quickly as possible, without tying up processing or causing the View to lock up.

Thoughts?

  • 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-05-15T18:38:54+00:00Added an answer on May 15, 2026 at 6:38 pm

    Unless you do it yourself, using Method 1) does not introduce any multithreading. Invoking an action (unless you call BeginInvoke) does so synchronously, just like any normal method call.

    I would advocate Method 2). There is no need to tie it to one single consumer. If you use this queue as a single point of contact between X cameras and Y processors, you’ve decoupled the cameras from the processors and could modify the value of X and Y independently.

    EDIT

    At the risk of being accused of blog spam here, I remembered that I wrote a component that’s similar (if not an exact match) for what you’re looking for awhile ago. See if this helps:

    ProcessQueue

    The gist of it is that you provide the queue with a delegate that can process a single item–in your case, Image–in the constructor, then call Start. As items are added to the queue using Enqueue, they’re automatically dispatched to an appropriate thread and processed.

    For example, if you wanted to have the image move Camera->Processor->Writer (and have a variable number of each), then I would do something like this:

    ProcessQueue<Foo> processorQueue = new ProcessQueue<Foo>(f => WriteFoo(f));
    ProcessQueue<Image> cameraQueue = new ProcessQueue<Image>(i => processorQueue.Enqueue(ProcessImage(i)));
    

    You could vary the number of threads in cameraQueue (which controls the image processing) and processorQueue (which controls writing to disk) by using SetThreadCount.

    Once you’ve done that, you would just call cameraQueue.Enqueue(image) whenever a camera captured an image.

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

Sidebar

Related Questions

I have a fps camera and a model of a gun that follows her,
I have a camera class that holds a picture of the camera using SurfaceHolder
I have an ImageManipulator class that performs some cropping, resizing and rotating of camera
I have made an openGL camera class that uses lazy evaluation to provide the
I have made an openGL camera class that uses lazy evaluation to provide the
I am using MediaCapture class for camera view. But i have a problem that
I have a camera class that has two pointers as parameters: Camera::Camera( float fOVDeg,
I have an abstract class Camera. There are some derived classes that will handle
Suppose I have the following class: class Camera { public Camera( double exposure, double
I have a working wrapper class for Dallmeier camera devices, It contains a callback

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.