1 | initial version |
You are talking about template matching, in which one provides a template and a scene, and OpenCV outputs the matches. However, for this to work, you need to provide static images as templates. It does not matter if your scene is dynamic, but your templates should be static.
If your game is continuously running, this means it changes its frame every second, so how do you expect OpenCV to match the template over thousands of frames? You need a match, if you do not have any commonality between your template (sample frames from your game) and your scene (your game in this case), then do not expect OpenCV to achieve what you want.
So the answer to your question is no.
However, if all you want is to detect the window where your game is running, this is an easier task, and in that case the question should be rephrased.
2 | No.2 Revision |
You are talking about template matching, in which one provides a template and a scene, and OpenCV outputs the matches. However, for this to work, you need to provide static images as templates. It does not matter if your scene is dynamic, but your templates should be static.
If your game is continuously running, this means it changes its frame frames every second, second and gets always new frames, so how do you expect OpenCV to match the template template(s) over thousands of frames? frames which? You need a match, if you do not have any commonality between your template (sample frames from your game) and your scene (your real time running game in this case), then do not expect OpenCV to achieve what you want. Remember, what you are looking for in the scene, should have something in common with the template. If you are looking for a character in your game screen for instance, and if that character is always present, then you can achieve this with template matching. But the whole frame you cannot match, since there would not be any commonality between your template frames and real-time frames.
So the answer to your question is no.
However, if all you want is to detect the window where your game is running, this is an easier task, and in that case the question should be rephrased.
3 | No.3 Revision |
You are talking about template matching, in which one provides a template and a scene, and OpenCV outputs the matches. However, for this to work, you need to provide static images as templates. It does not matter if your scene is dynamic, but your templates should be static.
If your game is continuously running, this means it changes its frames every second and gets always new frames, so how do you expect OpenCV to match the template(s) over thousands of frames which? You need a match, if you do not have any commonality between your template (sample frames from your game) and your scene (your real time running game in this case), then do not expect OpenCV to achieve what you want. Remember, what you are looking for in the scene, should have something in common with the template. If you are looking for a character in your game screen for instance, and if that character is always present, then you can achieve this with template matching. matching, like here in the bottom there is an example from a Mario game. But the whole frame you cannot match, since there would not be any commonality between your template frames and real-time frames.
So the answer to your question is no.
However, if all you want is to detect the window where your game is running, this is an easier task, and in that case the question should be rephrased.
4 | No.4 Revision |
You are talking about template matching, in which one provides a template and a scene, and OpenCV outputs the matches. However, for this to work, you need to provide static images as templates. It does not matter if your scene is dynamic, but your templates should be static.
If your game is continuously running, this means it changes its frames every second and gets always new frames, so how do you expect OpenCV to match the template(s) over thousands of frames which? frames? You need a match, if you do not have any commonality between your template (sample frames from your game) and your scene (your real time running game in this case), then do not expect OpenCV to achieve what you want. Remember, what you are looking for in the scene, should have something in common with the template. If you are looking for a character in your game screen for instance, and if that character is always present, then you can achieve this with template matching, like here in the bottom there is an example from a Mario game. But the whole frame you cannot match, since there would not be any commonality between your template frames and real-time frames.frames.
So the answer to your question is no.
However, if all you want is to detect the window where your game is running, this is an easier task, and in that case the question should be rephrased.