Skip to main content

Relative Luminance gradient and Dominant Color of Frames (RLGDCF) based Digital Video Fingerprinting.

Project description

Relative Luminance gradient and Dominant Color of Frames (RLGDCF) based Digital Video Fingerprinting

Introduction

Relative Luminance gradient and Dominant Color of Frames (RLGDCF) based Digital Video Fingerprinting is a novel but straightforward video fingerprinting technique that generates the fingerprint for any video by extracting one frame per second and reducing these frames to a single latin alphabet.

First, find the dominant color of the frame using the imagedominantcolor python package, it outputs one character out of r, g, b, l, and n whenever an image is passed to it.

Output dominant color and their meanings:

  • r - Red is the dominant color in the image.
  • g - Green is the dominant color for the image.
  • b - Blue is the dominant color.
  • l - It is lowercase L and it implies that the image is mostly grayscale. L for luminance and most of the image lacks color.
  • n - None of the colors out of r, g, and b are dominant but the image is also not grayscale. It implies that the image has equal regions where 2 or 3 colors dominate, for example here.

Then calculate the luminance value of the frame and compare it with the luminance value of the frame preceding the current frame. As the first frame can not have a preceding frame we set its value to 0. For all the remaining frames, set their value to 0 if the current frame is brighter or at least equally bright when compared to the preeceding frame. If the preceding frame is brighter compared to the current frame then set the value of the current frame to 1.

If the number is 0, make the dominant color alphabet lowercase and if the number is 1 then make the dominant color alphabet uppercase.

Examples:

  • If the dominant color is r and the number is 1, then the character that should represent the frame should be R.

  • If the dominant color value is n and the number is 0, then the character that should represent the frame should be n.

And remember that you don't have to stick to these original rules, you can flip them but just stay consistent and it's guaranteed that your implementation will work. Also, any other dominant color of the image detection library will do great as long as the output is deterministic.

Installation

pip install videofingerprint -U

Usage

>>> import videofingerprint
>>>
>>> url1 = "https://www.youtube.com/watch?v=PapBjpzRhnA"
>>> url2 = "https://raw.githubusercontent.com/akamhy/videohash/main/assets/rocket.mkv"
>>>
>>> vp1 = videofingerprint.VideoFingerprint(url=url1)
>>> vp2 = videofingerprint.VideoFingerprint(url=url2)
>>> vp1.fingerprint
'rrbBbbBLlrrRrRrnNBbbbnnrBBbbBLlrrrRRnnnnLLLLLllllllllL'
>>> vp2.fingerprint
'rrbBbbBLlrrRrRrrNBbbbnnrBBbbBLlrrrRRnnNnBLLLLllllllllL'
>>>

🛡 License

License: MIT

Copyright (c) 2022 Akash Mahanty. See license for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

videofingerprint-0.0.3.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

videofingerprint-0.0.3-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file videofingerprint-0.0.3.tar.gz.

File metadata

  • Download URL: videofingerprint-0.0.3.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for videofingerprint-0.0.3.tar.gz
Algorithm Hash digest
SHA256 fce5689e735e9a95e5cb0522e3d969992f2adb72d39fde85334d9afffc5c2cdf
MD5 8cf3981d27653276e8650efbc6d8e0ad
BLAKE2b-256 9793984f3e92005bb14be0e2b6b5b43a98b2c48965473ecf759c98768801c789

See more details on using hashes here.

File details

Details for the file videofingerprint-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: videofingerprint-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for videofingerprint-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 188a2cf555e66e415ebcf5a5e631c8d9b5d5300e7a5717ceaf82bdb18599ba61
MD5 c3c38480a4bdc15ef99b7324d9bb74be
BLAKE2b-256 f5c87c8e3b7071f2b7c093847504bd8608e3e3ae6c56e7af5d4261f27e324f97

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page