I want to realize the function of the is:
1. The use of OPENCV, through camera to real-time people gesture recognition, including stone, scissors and paper three gestures (single gesture recognition tracking procedure no problem), among them, the main executive body gesture recognition procedure is a while loop, roughly as follows:
while (capture)//the capture to get the camera signal, here for real-time tracking calculation
{
Gestures to detect recognition...
}
This program is exclusive of CPU, as long as the start will continue in the while loop execution;
2. The use of random function, randomly generated 1, 2, 3, one of the three Numbers to represent computer mora results; And gesture recognition program does not have any data interaction;
Because of gesture recognition program has an exclusive feature, in the process of cycle test can't be other unrelated calculation, so I took into account the multithreading, simply use under Windows before handle and CreateThread function, but under the MFC use worker threads or when the user thread (tried), are encountered after starting gesture recognition threads to other operating problems, I want to ask isn't multithreaded MFC window in the true sense of multithreading? (I've seen some people say that the MFC window is single-threaded, sweat ~ ~),
I also thought of many other ways to detect interrupt gestures, such as in computer punch thread postmessage a signal to the gesture recognition threads, but met start gesture recognition thread cannot perform computer punch thread; Also considered additional set a gesture recognition window, and set a on_clicked_button trigger to cancel gesture recognition thread and the window, but after trying don't interrupt while (capture), good tenacity T.T, feeling I like is not really a multithreading, or a single thread sequentially,
Saw cbNotes the large post, benefits, but described in the user thread, copying files actually is also a single task thread, involves copying files, only new window displaying the progress of copying files is updated, so doubt whether really is multithreaded, MFC cbNotes big post address: http://blog.csdn.net/cbnotes/article/details/8465212
Anyone can greatly help me to solve it? Or put forward some new solutions, not very grateful!
CodePudding user response:
Multiple Threads in the User Interface of http://msdn.microsoft.com/zh-cn/library/ms810439.aspxCodePudding user response:
Don't you go to not go to find information online search, started Posting to doubt the things they don't know is it ok, who do you think will answer your question?CodePudding user response:
Thread proper Sleep in a while loop to yield the CPU to other threadsCodePudding user response: