4

I'm trying to analyze a video file and detect if it has a network logo on the bottom right corner. I figured it might be easier if I just take a few random frames and see if they have a logo/water mark in common.

I just have no idea how to start. is there any to do this using API/Command line?

hakre
  • 193,403
  • 52
  • 435
  • 836
kay.one
  • 7,622
  • 6
  • 55
  • 74

1 Answers1

2

First off, you won't likely fine a command line tool to do this.

Looking for commonality won't be as simple as you might think. All video is compressed and that causes slight differences even in things that may look the same to the human eye.

If you know the basic size and region of the logo, you can limit your search to that part of the screen which should make it faster. After that, I would, assuming I knew what the logo was, subtract one frame from the next. Do this by subtracting each color channel rom the corresponding color channel of the same pixel on the previous frame. If you have a lot of video, perhaps take some frames a ways apart so a slow moving part of the picture won't cause a false positive. Once you have this subtraction, anything that is the same should be a value near zero. Anything different should be a much higher value.

With this subtracted region, if there are a lot of pixels near zero, you probably have the logo or at least something constant. You might want to square the results and then add them up. This will exaggerate the values not near zero. Then pick a threshold. If the values are below that, you likely have a logo.

Steve Rowe
  • 19,411
  • 9
  • 51
  • 82
  • This will probably work with some tweaking. However I would go for calculating color averages for each pixel (for each color channel) and then standard deviation for each pixel. Finally just look for areas with low deviation result. – virco Jul 05 '16 at 08:24