OpenCV image (frame) search in video

I am trying to create a small C ++ application that will return a probability value (a real number from 0 to 1) for recognizing two images in a video. My idea is to find ads in certain videos. I thought about trimming the first frame with both commercial and last. That way, I could create an application using OpenCV that would download the video (TV content) and then look for the first frame tagged from the advertisement. If he finds it (with a probability of more than SOME_PARAMETER) than the application can conclude that these commercials begin there. Then I would like to find the last frame, and if it is found (again with a probability of more than SOME_PARAMETER) than the application can come to the conclusion that the desired commercial content really exists in this video. This is just an idea. I am an expert in C ++, but new to OpenCV. If someone can point me or give an example, it will be very appreciated. Of course, I am open to any suggestions regarding the idea. Thanks,

M.

+6
source share
1 answer

What you are looking for is known as pattern matching in OpenCV.

To get acquainted with OpenCV, you should start reading several tutorials , besides books there are some good ones on the Internet. As a C ++ guy, you'll probably use the OpenCV C ++ interface , which uses cv::Mat as the main data structure for representing images. If you see the IplImage data type used, IplImage it from the C interface.

After the preliminary results, you will eventually need to learn how to read frames from the video:

and then how to process these frames separately:

Finally, you explore how pattern matching works:

There are other ways to track objects besides matching the pattern, check these links:

+11
source

All Articles