Zurück zur Übersicht

PyMatting: A Python Library for Alpha Matting

full text: PDF
author/s: Stefan Conrad, Thomas Germer, Stefan Harmeling, Tobias Uelwer
journal:Journal of Open Source Software

A fundamental problem of many image processing tasks is the extraction of specific objects from an image in order to place them in a scene of a movie or compose them onto another background. Alpha matting describes the problem of separating the objects in the foreground from the background of an image given only a rough sketch. Besides everyday image editing, alpha matting has been applied to medical image analysis and microscopy image restoration. For an image I with foreground pixels F and background pixels B, alpha matting asks to determine opacities α, such that the equality Iᵢ = α Fᵢ + (1 - α) Bᵢ holds for every pixel i. This problem is ill-posed since, for each pixel, we have three equations (one for each color channel) with seven unknown variables. The implemented methods rely on a trimap, which is a rough classification of the input image into foreground, background and unknown pixels, to further constrain the problem. Subsequently, the foreground F can be extracted from the input image I and the previously computed alpha matte α using a foreground estimation method. We introduce the PyMatting toolbox for Python which implements various approaches to solve the alpha matting problem. Our library is also able to extract the foreground of an image given the alpha matte. The target audience are researchers of image processing and computer vision. The implementation aims to be computationally efficient and easy to use.

Heinrich Heine Universität

Datenbanken und Informationssysteme


Prof. Dr. Stefan Conrad

Universitätsstr. 1
40225 Düsseldorf
Gebäude: 25.12
Etage/Raum: 02.24
Tel.: +49 211 81-14088


Sabine Freese

Mo-Fr: 10:00-11:30 Uhr
Mo-Do: 13:00-14:30 Uhr

Universitätsstr. 1
40225 Düsseldorf
Gebäude: 25.12
Etage/Raum: 02.22
Tel.: +49 211 81-11312
Fax: +49 211 81-13463
Verantwortlich für den Inhalt:  E-Mail senden Datenbanken & Informationssysteme