Would threading help me process images faster?

64 Views Asked by At

I am using Java to create a color detection algorithm.

Here is how it works:

  1. A screen capture is taken of a portion of the screen around the cursor
  2. Every pixel in that capture is checked to see if it is within a range of colors or not
  3. The average of valid pixels is calculated
  4. The cursor is moved to that average

I am hoping to get it to work at 50 - 100 times per second. For the most part the time taken to complete the process does take under 20 ms. However, sometimes it goes over 20 ms, and it takes even longer for bigger screen captures. So, I was thinking of using threads to help solve my problem. However, I have heard that threads split the CPUs processing power. So, I was wondering if using multiple threads to process these captures would help my program run faster.

0

There are 0 best solutions below