Starting resources for recognizing a pattern in a video (basic computer vision)?

Status
Not open for further replies.

mphuie

Smack-Fu Master, in training
97
I deal with a lot of video game streams (fighting game) and would like to develop some simple automation to detect when matches start and end.

This pretty much entails finding timecodes for the when the large 'Ready, Fight' and 'KO!' graphics are shown in a video. I guess this doesn't really need to deal with video as it could just break the video down into frame and match a pattern in an image.

Does anyone have any suggestions on how to do this? I looked at a few OpenCV tutorials but they are way over my head, and I'm not sure I need something that complex.

Any suggestions? I'm fairly proficient is just about any scripting language.
 
Assuming 'Ready Fight' and 'KO' are always the same colors and in the same location then its a simple bitmap mask compare of the incoming images.

1. Create a bitmap mask of what you want to find. i.e. take a screen shot of what you want to see and set everything irrelevant to zero.
2. When a frame comes in compare it to the mask ignoring the zeros in the mask.

You probably want to resize the mask and the incoming frame to something small to be fast, and you probably don't need to look at every frame, say every 10.
 

chaboud

Ars Centurion
313
Subscriptor
Yeah, I'd have to agree. If you're basically trying to find state transitions in a fighting game, the overlays like "Ready Fight" are likely to be in the same place on the screen at some point. If this is the case, masking off the pixels outside of this text should allow you to compare what is in the image for correlation with your reference pattern. You don't care about traditional pattern matching problems. Simplify this one.


Even traditional correlative filters aren't necessary here. If all you had to do was find out if the exact pixels were a match (or near match), you might be able to get away with a small subset mask and an additive difference filter.


Unless you care about traditional pattern matching... In which case, OpenCV isn't a bad place to look. If that is too out of reach, I know of some very good books to come up to speed on pattern recognition, but they are *highly* dependent on your math level. Some sense of where you are in calculus, discrete math, and optimization would all be important, as would some more detailed understanding of the fundamental problem that you are trying to solve. Also, are you looking for canned tricks or a genuine understanding of the math? No need to get into vector calculus if you just want code that works.
 

fjellfras

Seniorius Lurkius
47
chaboud":2ru6vusd said:
Yeah, I'd have to agree. If you're basically trying to find state transitions in a fighting game, the overlays like "Ready Fight" are likely to be in the same place on the screen at some point. If this is the case, masking off the pixels outside of this text should allow you to compare what is in the image for correlation with your reference pattern. You don't care about traditional pattern matching problems. Simplify this one.


Even traditional correlative filters aren't necessary here. If all you had to do was find out if the exact pixels were a match (or near match), you might be able to get away with a small subset mask and an additive difference filter.


Unless you care about traditional pattern matching... In which case, OpenCV isn't a bad place to look. If that is too out of reach, I know of some very good books to come up to speed on pattern recognition, but they are *highly* dependent on your math level. Some sense of where you are in calculus, discrete math, and optimization would all be important, as would some more detailed understanding of the fundamental problem that you are trying to solve. Also, are you looking for canned tricks or a genuine understanding of the math? No need to get into vector calculus if you just want code that works.

Sorry for hijacking the thread for a moment, but would you mind posting the titles of these books please? I am doing something related to machine learning as a side project right now and I would love to gain better understanding on pattern recognition, as at some point in my project I will need to compare images efficiently. I have a fairly decent mathematical background as far as calculus and discrete math are concerned, not so much on optimization though.
 

chaboud

Ars Centurion
313
Subscriptor
Yeah, sure. If I were to narrow the field down, my favorites were, from favorite to still like it:

A Probabilistic Theory of Patter Recognition - Devroye
Computer Vision: Algorithms and Applications - Szeliski
Neural Networks for Pattern Recognition - Bishop
Pattern Recognition and Machine Learning - Bishop

I'd say that access to the ACM portal trumps all of these books. Even if it's gleaned from somewhat tangential subjects, like point-cloud or feature registration. Oh, and everyone in this space should have some version of Numerical Recipes.

To be fair, I've been interested in Brunelli's book (Template Matching Techniques in Computer Vision), so the list is subject to change.

It really does depend on the level of math that one comes in with and the depth to which one wants to dig. I'd wager that the majority of computer vision problems could be resolved with OpenCV these days. Understanding the underlying approach lets you know why it goes terribly wrong.
 

fjellfras

Seniorius Lurkius
47
chaboud":2iel6giy said:
Yeah, sure. If I were to narrow the field down, my favorites were, from favorite to still like it:

A Probabilistic Theory of Patter Recognition - Devroye
Computer Vision: Algorithms and Applications - Szeliski
Neural Networks for Pattern Recognition - Bishop
Pattern Recognition and Machine Learning - Bishop

I'd say that access to the ACM portal trumps all of these books. Even if it's gleaned from somewhat tangential subjects, like point-cloud or feature registration. Oh, and everyone in this space should have some version of Numerical Recipes.

To be fair, I've been interested in Brunelli's book (Template Matching Techniques in Computer Vision), so the list is subject to change.

It really does depend on the level of math that one comes in with and the depth to which one wants to dig. I'd wager that the majority of computer vision problems could be resolved with OpenCV these days. Understanding the underlying approach lets you know why it goes terribly wrong.

Thanks for this. I have both of the books by Bishop and I am going through the Neural networks book at this time for the project. I will probably look into Devroye book next.
 
Status
Not open for further replies.