Video matting explained

Video matting is a technique for separating the video into two or more layers, usually foreground and background, and generating alpha mattes which determine blending of the layers. The technique is very popular in video editing because it allows to substitute the background, or process the layers individually.

Video matting methods

Problem definition

When combining two images the alpha matte is utilized, also known as the transparency map. In the case of digital video, the alpha matte is a sequence of images. The matte can serve as a binary mask, defining which of the image parts are visible. In a more complicated case it enables smooth blending of the images, the alpha matte is used as the transparency map of the top image. Film production has known alpha matting since the very creation of filmmaking. The mattes were drawn by hand. Nowadays, the process can be automatized with computer algorithms.

The basic matting problem is defined as following: given an image

I

, compute the foreground

F

, background

B

and alpha matte

A

, such that the equation

I=AF+(1-A)B

holds true. This equation has trivial solution

A=1

,

F=I

,

B

is any image. Thus, usually an additional trimap must be provided as input. The trimap specifies background, foreground, and uncertain pixels, which will be decomposed into foreground and background by the matting method.

The main criteria for video matting methods from a user perspective are following:

Methods description

The first known video matting method [1] was developed in 2001. The method utilizes optical flow for trimap propagation and a Bayesian image matting technique which is applied to each image separately.

Video SnapCut,[2] which later was incorporated in Adobe After Effects as Roto Brush tool, was developed in 2009. The method makes use of local classifiers for binary image segmentation near the target object's boundary. The results of the segmentation are propagated to the next frame using optical flow, and an image matting algorithm [3] is applied.

A method [4] from 2011 was also included in Adobe After Effects as Refine Edge tool. The propagation of trimap with optical flow was enhanced with control points along the object edge. The method uses per-image matting, but temporal coherence was improved with a temporal filter.

Finally, a deep learning method [5] was developed for image matting in 2017. It overcomes most traditional methods.

Benchmarking

Video matting is a rapidly-evolving field with many practical applications. However, in order to compare the quality of the methods, they must be tested on a benchmark. The benchmark consists of a dataset with test sequences and a result comparison methodology. Currently there exists one major video matting online benchmark, which uses chroma keying and stop motion for ground truth estimation. After method submission, the rating for each method is derived from objective metrics. As objective metrics do not represent human perception of quality, a subjective survey is necessary to provide adequate comparison.

Top 5 video matting methods [6]
Method Year of development Ranking place
Deep Image Matting 2016 1
Self-Adaptive [7] 2016 2
Learning Based [8] 2009 3
Sparse Sampling [9] 2016 4
Closed Form 2008 5

Practical use

Object cutout

Video matting methods are required in video editing software. The most common application is cutting out and transferring an object into another scene. The tool allows users to cut out a moving object by interactively painting areas that must or must not belong to the object, or specifying complete trimaps as input. There are several software implementations:

To enhance the speed and quality of matting, some methods use additional data. For example, time-of-flight cameras had been explored in real-time matting systems.[12]

Background replacement

Another application of video matting is background matting, which is very popular in online video calls. A Zoom plugin had been developed,[13] and Skype announced Background Replace in June 2020.[14] Video matting methods also allow to apply video effects only to background or foreground.

3D video editing

Video matting is crucial in 2D to 3D conversion, where the alpha matte is used to correctly process transparent objects. It is also employed in stereo to multiview conversion.

Video completion

Closely related to matting is video completion [15] after removal of an object in the video. While matting is used to separate the video into several layers, completion allows to fill gaps with plausible contents from the video after removing one of the layers.

External links

Notes and References

  1. Chuang. Yung-Yu. Agarwala. Aseem. Curless. Brian. Salesin. David H.. Szeliski. Richard. Video matting of complex scenes. ACM Transactions on Graphics. 21. 3. 2002. 243–248. 0730-0301. 10.1145/566654.566572.
  2. Video SnapCut. Bai. Xue. Wang. Jue. Simons. David. Sapiro. Guillermo. ACM Transactions on Graphics. 28. 3. 2009. 1–11. 0730-0301. 10.1145/1531326.1531376.
  3. Levin. A.. Lischinski. D.. Weiss. Y.. A Closed-Form Solution to Natural Image Matting. IEEE Transactions on Pattern Analysis and Machine Intelligence. 30. 2. 2008. 228–242. 0162-8828. 10.1109/TPAMI.2007.1177. 18084055.
  4. Book: Bai. Xue. Wang. Jue. Simons. David. Computer Vision/Computer Graphics Collaboration Techniques. Towards Temporally-Coherent Video Matting. Lecture Notes in Computer Science. 6930. 2011. 63–74. 0302-9743. 10.1007/978-3-642-24136-9_6. 978-3-642-24135-2.
  5. Book: Xu. Ning. Price. Brian. Cohen. Scott. Huang. Thomas. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Deep Image Matting. 2017. 311–320. 10.1109/CVPR.2017.41. 978-1-5386-0457-1. 14061786 .
  6. Book: https://videomatting.com/ . Erofeev. Mikhail. Gitman. Yury. Vatolin. Dmitriy. Fedorov. Alexey. Wang. Jue. Proceedings of the British Machine Vision Conference 2015. Perceptually Motivated Benchmark for Video Matting. 2015. 99.1–99.12. 10.5244/C.29.99. 978-1-901725-53-7.
  7. Cao. Guangying. Li. Jianwei. Chen. Xiaowu. He. Zhiqiang. Patch-based self-adaptive matting for high-resolution image and video. The Visual Computer. 35. 1. 2017. 133–147. 0178-2789. 10.1007/s00371-017-1424-3. 24625947 .
  8. Kambhamettu . Chandra . 2009 IEEE 12th International Conference on Computer Vision . Learning based digital matting . IEEE . 2009 . 889–896 . 978-1-4244-4420-5 . 10.1109/iccv.2009.5459326 .
  9. Book: Karacan. Levent. Erdem. Aykut. Erdem. Erkut. 2015 IEEE International Conference on Computer Vision (ICCV). Image Matting with KL-Divergence Based Sparse Sampling. 2015. 424–432. 10.1109/ICCV.2015.56. 978-1-4673-8391-2. 2174306 .
  10. Interactive video cutout. Wang. Jue. Bhat. Pravin. Colburn. R. Alex. Agrawala. Maneesh. Cohen. Michael F.. ACM Transactions on Graphics. 24. 3. 2005. 585–594. 0730-0301. 10.1145/1073204.1073233.
  11. Web site: Matting plugin for Adobe After Effects. 2021-03-02 .
  12. Wang . Liang . Gong . Minglun . Zhang . Chenxi . Yang . Ruigang . Zhang . Cha . Yang . Yee-Hong . Automatic Real-Time Video Matting Using Time-of-Flight Camera and Multichannel Poisson Equations . International Journal of Computer Vision . Springer Science and Business Media LLC . 97 . 1 . 2011-06-15 . 0920-5691 . 10.1007/s11263-011-0471-x . 104–121. 255108880 .
  13. Web site: Real-Time High Resolution Background Matting. 2021-03-02 .
  14. Web site: Introducing Background Replace in Skype. 2021-03-02 .
  15. Web site: Video Completion Benchmark. 2021-03-10 .