Skip to main content

Calculates the optical flow according to Gunnar-Farneback

Project description

Optical Flow

Allows, based on the calculation of the Gunnar-Farneback optical flow, to observe the movement of objects within the spot. The result is divided into the total moving pixels, the movement of the pixels up, right, down and left and the speed with which the pixels move between two frames.

Installation

Run

pip install Optical-Flow-Gunnar-Farneback==3.0

Usage

Import and run optical_flow

from optical_flow import optical_flow

of = optical_flow.get_OF(scaling, inputPath, outputPath, information_saved))
of = optical_flow.get_OF(0.3, "W1_01_eon.mp4", '/Results/', 1) #An example of how function is called 
#Scaling float between 0.0 and 1.0; inputPath = str; outputPath = str; information_saved between 0.1 and max FPS)
of
# [(VideoDuration = 1.04, movedPixel = 0.662733593216252, upMovement = 0.24390145882731182, rightMovement = 0.4105051641683077, 
# downMovement = 0.16341277177189245, leftMovement = 0.17587911425471206, medianVelocity = 3.0)...]

# The length of the result list depends on the parameter information_saved.  

Ideas

The Scaling value is a factor that determines what percentage of the spot is viewed. With a value of 0.3, starting from the center of the video, 30 percent of the video is used to calculate the optical flow.
The Input Path describes the video to be used for the Optical Flow calculation.
The calculated video of the optical flow is stored under the Output Path.
The Information Saved value specifies how often information is saved. This function has been integrated due to the time-consuming time required. With a value of 1, the data is calculated 1x per second. If the FPS value of the video is used (e.g. FPS = 25), the data is saved every frame.

Maintainer

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

Optical Flow Gunnar-Farneback-3.0.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file Optical Flow Gunnar-Farneback-3.0.tar.gz.

File metadata

  • Download URL: Optical Flow Gunnar-Farneback-3.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for Optical Flow Gunnar-Farneback-3.0.tar.gz
Algorithm Hash digest
SHA256 9609cf9fc1aea74e7b8cfb04d4725baef4aa8456eb0372684a55450ba46143ea
MD5 647f1658f640952c45d494cd390dfcdd
BLAKE2b-256 40b97eabc04a00cafd119d7d87da166cb29d28743beea24369e6d3379d0be42b

See more details on using hashes here.

Supported by

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