Do you want to get a free consultation and project quote?
Back to list

Video comparison Python project

  • Python

Python-based video comparison project for a marketing company to track audience interest.

PCV -illustration.png

The algorithm we implemented can be described as follows:

  • ⁠Preprocessing (all information about the videos is extracted, aspect ratio, resolution and fps are taken into account for detailing further analysis);
  • Video frame generators are created based on derived parameters;
  • To each pair of frames the background subtraction is applied sequentially (clahe for further stabilization effect + bg sub);
  • The result of bg sub is followed with some morphological operations to eliminate small noise and improve strong regions of difference;
  • Then we search for rectangular regions of difference on resulting mask and apply SSIM check (and, if SSIM indicates difference indeed - additional SIFT check) to each region;
  • Once a number of different pairs reach the preset threshold of all frames or a big portion of consequent frames is different (running window approach), videos are labeled as different. If the threshold is not reached until the end, videos are considered equal.
  • Development time
    4 weeks of 1 developer