My program works as follows:
That is, I am trying to detect motion of objects that have skin color. But I want to speed up my program, so I thought about using parallel programming, where I use two threads, one for skin filtering, and one for motion detection, and then do a logical AND
of the results.
I am using C# and the Aforge.Net library. Can I do what I described using C#? Could you please give me some hints on how to accomplish what I have described? All I have been able to find is Parallel.For
.
There are several ways to do threaded and parallel processing in .NET:
You either can use a ThreadPool
. http://msdn.microsoft.com/en-us/library/system.threading.threadpool.aspx tells you more about this.
Maybe you can make use of TaskFactory.StartNew(...)
http://msdn.microsoft.com/en-us/library/dd321439.aspx instead.
Another way would be the BlockingCollection for .NET 4, see BlockingCollection Class in MSDN.
Also you could write your own ThreadPool-class.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.