Git Product home page Git Product logo

deblatting_python's Introduction

[IJCV 2021] Deblatting in Python

Python implementation of deblatting (deblurring and matting). We assume the following formation model of input image I:

This repository contains various algorithms to estimate unknown F, M and H. The background B is assumed to be given, for example by a median of 3-5 previous video frames.

Dependencies

The library is written in Python. The following packages are required: numpy, scipy, skimage. For visualization purposes, also opencv is recommended.

Using

All parameters are explained in Params() class. Provided script run.py shows examples how to use the methods. For GPU version in PyTorch check run_gpu.py.

Estimate F, M, H

The most general case is when everything needs to be estimated. In this case it is advisable to provide at least an approximate object size, e.g. by M0 = np.ones([diameter]*2). Otherwise an object of I.shape is being estimated, which can be slow. For speed up, inputs can be cropped to the area near the object of interest, or Hmask can be provided as a binary mask in the input image where the object is present.

H, F, M = estimateFMH(I, B, M0)

Estimate F, M given H

F, M = estimateFM(I, B, H)

Estimate H given F, M

H = estimateH(I, B, M, F)

Estimate (F_i, M_i) given (H_i)

Piece-wise deblatting. Single M0 = np.ones([diameter]*2) vs varying Ms0 = np.ones([diameter]*2 +[ns]), where ns is the number of splits.

Fs, Ms = estimateFM_pw(I, B, Hs, M0)

Fs, Ms = estimateFM_pw(I, B, Hs, Ms0)

GPU version in PyTorch

Input data must be 4-D in format (K,C,W,H), where K is the number of images in a batch, C is the number of channels, and W/H are image width and height. The output will be in the same format, and each image in the batch is processed in parallel.

H, F, M = estimateFMH_gpu(I, B, M0)
F, M = estimateFM_gpu(I, B, H)
H = estimateH_gpu(I, B, M, F)

Benchmarking

Evaluation on real-world data can be performed on the FMO deblurring benchmark.

Publications

This repository contains implementation of the following publications:

@inproceedings{Rozumnyi-et-al-IJCV-2021,
  author = {Denys Rozumnyi and Jan Kotera and Filip Sroubek and Jiri Matas},
  title = {Tracking by Deblatting},
  booktitle = {IJCV},
  doi = {10.1007/s11263-021-01480-w},
  month = jun,
  year = {2021}
}
@inproceedings{Rozumnyi-et-al-CVPR-2020,
  author = {Denys Rozumnyi and Jan Kotera and Filip Sroubek and Jiri Matas},
  title = {Sub-frame Appearance and 6D Pose Estimation of Fast Moving Objects},
  booktitle = {CVPR},
  address = {Seattle, Washington, USA},
  month = jun,
  year = {2020}
}
@inproceedings{Kotera-et-al-ICCVW-2019,
  author = {Jan Kotera and Denys Rozumnyi and Filip Sroubek and Jiri Matas},
  title = {Intra-frame Object Tracking by Deblatting},
  booktitle = {Internatioal Conference on Computer Vision Workshop (ICCVW), 
  Visual Object Tracking Challenge Workshop, 2019},
  address = {Seoul, South Korea},
  month = oct,
  year = {2019}
}

Other related papers:

@inproceedings{Rozumnyi-et-al-GCPR-2019,
  author = {Denys Rozumnyi and Jan Kotera and Filip Sroubek and Jiri Matas},
  title = {Non-Causal Tracking by Deblatting},
  booktitle = {GCPR},
  address = {Dortmund, Germany},
  month = sep,
  year = {2019}
}
@inproceedings{Rozumnyi-et-al-CVPR-2017,
  author = {Denys Rozumnyi and Jan Kotera and Filip Sroubek and Lukas Novotny and Jiri Matas},
  title = {The World of Fast Moving Objects},
  booktitle = {CVPR},
  address = {Honolulu, Hawaii, USA},
  month = jul,
  year = {2017}
}

deblatting_python's People

Contributors

rozumden avatar

Stargazers

 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

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.