DEV Community

Aleksandr Gushchin
Aleksandr Gushchin

Posted on โ€ข Edited on

1

August 02 - August 09 Weekly Status

This week I experimented with new metrics, which I implemented.

I implemented 2 metrics based on color histogram and motion vectors. Since motion vectors already used in current version of the algorithm I focused on hostogram metric. Code for it can be found here. I used histogram crate for this implementation. I calculate histogram of the first plane of the frame (luma component) and compare it to the previous frame's histogram. I used 4 metrics to calculate differences between these histograms:

  1. The difference between mean values
  2. The difference between std values
  3. Taxicab distance Alt Text here p, q - histograms, n - amount of bins in each.
  4. The square of the Euclidean distance

After that I substract current value from previous to make peaks more distinctive for the threshold.

Below you can find examples of these 4 distances in the same order on the same video. These pictures have scene changes (gray vertical lines) and final metric (blue line):
Alt Text

Alt Text

Alt Text

Alt Text

It can be seen that the metric with the least distinctive peaks is the one with STD difference.

Below you can find results for the first two distances:

  • Mean values of histograms: Alt Text Alt Text Alt Text
  • STD values of histograms: Alt Text Alt Text Alt Text

Below you can see the results for these metrics of BBC Planet Earth dataset and manually marked up open source videos:

Metric F score on BBC Planet Earth F score on open source videos
#1(mean) 0.8502 0.6532
#2(std) 0.6543 0.5951
#3(Euclidian) 0.7031 0.6002
#4(Taxicab) 0.7143 0.6231

The speed of the algorithm with this metric is ~0.87x speed of current version of the algorithm.

Summary:
The F score of new metrics is better than the current one.
New metrics are a bit slower that the current metric.

But since they use different characteristics of the frame (motion vectors and color histograms) in combination they could enhance each other and increase the final F score.

TO DO:
Precision recall curves for these metrics with different thresholds.
Correlation with previous metric. Would it be better to combine these metrics or use them separately?

Hot sauce if you're wrong - web dev trivia for staff engineers

Hot sauce if you're wrong ยท web dev trivia for staff engineers (Chris vs Jeremy, Leet Heat S1.E4)

  • Shipping Fast: Test your knowledge of deployment strategies and techniques
  • Authentication: Prove you know your OAuth from your JWT
  • CSS: Demonstrate your styling expertise under pressure
  • Acronyms: Decode the alphabet soup of web development
  • Accessibility: Show your commitment to building for everyone

Contestants must answer rapid-fire questions across the full stack of modern web development. Get it right, earn points. Get it wrong? The spice level goes up!

Watch Video ๐ŸŒถ๏ธ๐Ÿ”ฅ

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

๐Ÿ‘‹ Kindness is contagious

If you found this article helpful, please give a โค๏ธ or share a friendly comment!

Got it