Coder Social home page Coder Social logo

ofps's Introduction

Optical Flow Processing Stack

OFPS is a generic optical flow processing library, and OFPS Suite is an accopanying app demonstating its functionality.

Running OFPS Suite

  1. Install the latest stable Rust toolchain (version 1.60.0) through https://rustup.rs/.

  2. Install dependencies (see dedicated subsection).

  3. Build default plugins with cargo build --release

  4. Optionally, build libmv estimator (more involved, see its subsection).

  5. Run OFPS suite with cargo run --release --bin ofps-suite

Installing dependencies

Ubuntu/Debian:

sudo apt-get install atk1.0 libgtk-3-dev ffmpeg libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev libopencv-dev libclang-dev clang libxcb-shape0-dev libxcb-xfixes0-dev

Fedora:

sudo dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install gtk3-devel clang clang-devel opencv-devel ffmpeg-devel

Windows/macOS:

Good luck :)

Building libmv estimator

First, make sure libmv submodule is initialised:

git submodule update --init

Then, source the environment at the root of the repo

source env

Then, install extra dependencies:

Ubuntu/Debian:

sudo apt-get install cmake libceres-dev libjpeg-dev

Fedora:

sudo dnf install cmake ceres-solver-devel libjpeg-turbo-devel

Go to libmv-rust/libmv directory. Run make. Not everything will compile. That is okay - we only need libmultiview.so and its dependencies.

Go back to root of the repo, run cargo build --release --workspace.

Troubleshooting

Set log level to see errors better:

export RUST_LOG=<trace,debug,info,warn,error>

If it is a graphics issue, try forcing OpenGL backend:

export WGPU_BACKEND=gles

Documentation

Assuming the workspace compiles, following steps 1-3 of OFPS Suite section, run cargo doc --open.

Unit tests

Assuming the workspace compiles, run cargo test.

Example configurations

Download core samples from Google Drive, and extract samples.zip (sha256 - c1a27a0716b5633792afca7c1a032dcc9c15c8f7153a03e8d5206e1d86379896) in the project root under samples directory. Raw detection sample was large, thus it has been separated into cctv.h264 file (sha256 - 9fd17d015924538c140f9ee478bdbfc5233f6c948ff134d2f31415e795da9b66). Place it in samples/detection directory. Locations are important, because predefined configs reference paths relative to current working directory.

Detection Configurations

Load predefined configuration files from the paths given (by clicking on the large detection title button).

  • Scenario from Results - samples/scenario_detect.json (requires raw sample).

  • Basic motion - samples/basic_detect.json.

  • Live TCP stream (webcam) - samples/tcp_detect.json.

For V4L webcam through TCP, first run the following command in another terminal:

ffmpeg -i /dev/video1 -c:v libx264 -r 30 -preset ultrafast -tune zerolatency -x264-params "" -f mpegts tcp://0.0.0.0:3333\?listen

Adjust /dev/video1 to correct V4L device. The command needs to be re-run after each connection instance.

Tracking Configurations

Load predefined configuration files from the paths given (by clicking on the large tracking title button).

  • Synthetic videos, all estimators, ground truth comparisons - samples/synthetic_all_gt.json.

  • Synthetic videos, single estimator, ground truth - samples/synthetic_almeida_gt.json.

  • Real-world videos - samples/real_world.json.

  • Real-world videos (cropped, slowmo) - samples/real_world_crop.json.

  • Live TCP stream (webcam) - samples/tcp_track.json.

The preloaded samples can be replaced with different ones. See samples/synthetic and samples/real_world directories. Cropped config is needed to account for 1.2x sensor crop applied on slow motion video.

For TCP configuration, refer to the previous subsection for setup steps. In addition, camera's horizontal and vertical field of view must be set correctly for tracking to be accurate.

ofps's People

Contributors

h33p avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gurpreetshanky

ofps's Issues

can not run on ubuntu virtual machine

cargo run --bin ofps-suite
Finished dev [unoptimized + debuginfo] target(s) in 0.41s
Running target/debug/ofps-suite
[2022-08-23T03:34:23Z ERROR wgpu_hal::gles::egl] EGL 'eglCreateContext' code 0x3005: eglCreateContext
Error: Failed to get adapter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.