You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/alphamat/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,12 @@ This project was part of the Google Summer of Code 2019.
7
7
***
8
8
Alphamatting is the problem of extracting the foreground from an image. Given the input of an image and its corresponding trimap, we try to extract the foreground from the background.
9
9
10
-
This project is implementation of "[[Designing Effective Inter-Pixel Information Flow for Natural Image Matting](http://people.inf.ethz.ch/aksoyy/ifm/)]" by Yağız Aksoy, Tunç Ozan Aydın and Marc Pollefeys[1]. It required implementation of parts of other papers [2,3,4].
10
+
This project is implementation of "[Designing Effective Inter-Pixel Information Flow for Natural Image Matting](https://www.researchgate.net/publication/318489370_Designing_Effective_Inter-Pixel_Information_Flow_for_Natural_Image_Matting)" by Yağız Aksoy, Tunç Ozan Aydın and Marc Pollefeys[1]. It required implementation of parts of other papers [2,3,4].
11
11
12
12
13
13
## References
14
14
15
-
[1] Yagiz Aksoy, Tunc Ozan Aydin, Marc Pollefeys, "[Designing Effective Inter-Pixel Information Flow for Natural Image Matting](http://people.inf.ethz.ch/aksoyy/ifm/)", CVPR, 2017.
15
+
[1] Yagiz Aksoy, Tunc Ozan Aydin, Marc Pollefeys, "[Designing Effective Inter-Pixel Information Flow for Natural Image Matting](https://www.researchgate.net/publication/318489370_Designing_Effective_Inter-Pixel_Information_Flow_for_Natural_Image_Matting)", CVPR, 2017.
16
16
17
17
[2] Roweis, Sam T., and Lawrence K. Saul. "[Nonlinear dimensionality reduction by locally linear embedding](https://science.sciencemag.org/content/290/5500/2323)" Science 290.5500 (2000): 2323-2326.
Copy file name to clipboardExpand all lines: modules/alphamat/include/opencv2/alphamat.hpp
+14-5
Original file line number
Diff line number
Diff line change
@@ -9,19 +9,28 @@
9
9
10
10
/**
11
11
* @defgroup alphamat Alpha Matting
12
-
* This module is dedicated to compute alpha matting of images, given the input image and an input trimap.
13
-
* The samples directory includes easy examples of how to use the module.
12
+
* Alpha matting is used to extract a foreground object with soft boundaries from a background image.
13
+
*
14
+
* This module is dedicated to computing alpha matte of objects in images from a given input image and a greyscale trimap image that contains information about the foreground, background and unknown pixels. The unknown pixels are assumed to be a combination of foreground and background pixels. The algorithm uses a combination of multiple carefully defined pixels affinities to estimate the opacity of the foreground pixels in the unkown region.
15
+
*
16
+
* The implementation is based on "Designing Effective Inter-Pixel Information Flow for Natural Image Matting" by Yağız Aksoy, Tunç Ozan Aydın and Marc Pollefeys, CVPR 2017.
17
+
*
18
+
* This module was developed by Muskaan Kularia and Sunita Nayak as a project
19
+
* for Google Summer of Code 2019 (GSoC 19).
20
+
*
14
21
*/
15
22
16
23
namespacecv { namespacealphamat {
17
24
//! @addtogroup alphamat
18
25
//! @{
19
26
20
27
/**
21
-
* The implementation is based on Designing Effective Inter-Pixel Information Flow for Natural Image Matting by Yağız Aksoy, Tunç Ozan Aydın and Marc Pollefeys, CVPR 2019.
28
+
* @brief Compute alpha matte of an object in an image
29
+
* @param image Input RGB image
30
+
* @param tmap Input greyscale trimap image
31
+
* @param result Output alpha matte image
22
32
*
23
-
* This module has been originally developed by Muskaan Kularia and Sunita Nayak as a project
24
-
* for Google Summer of Code 2019 (GSoC 19).
33
+
* The function infoFlow performs alpha matting on a RGB image using a greyscale trimap image, and outputs a greyscale alpha matte image. The output alpha matte can be used to softly extract the foreground object from a background image. Examples can be found in the samples directory.
Copy file name to clipboardExpand all lines: modules/alphamat/tutorials/alphamat_tutorial.markdown
+20-12
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,24 @@ This project was part of Google Summer of Code 2019.
7
7
8
8
*Mentor:* Sunita Nayak
9
9
10
-
Alphamatting is the problem of extracting the foreground from an image. The extracted foreground can be used for further operations like changing the background in an image.
10
+
Alphamatting is the problem of extracting the foreground with soft boundaries from a background image. The extracted foreground can be used for further operations like changing the background in an image.
11
11
12
12
Given an input image and its corresponding trimap, we try to extract the foreground from the background. Following is an example:
The computed alpha matte is saved as a greyscale image where the pixel values indicate the opacity of the extracted foreground object. These opacity values can be used to blend the foreground object into a diffferent backgound, as shown below:
20
+

17
21
18
-
This project is implementation of @cite aksoy2017designing . It required implementation of parts of other papers [2,3,4].
22
+
Following are some more results.
23
+

24
+
25
+
The first column is input RGB image, the second column is input trimap, third column is the extracted alpha matte and the last two columns show the foreground object blended on new backgrounds.
26
+
27
+
This project is implementation of @cite aksoy2017designing . It also required implementation of parts of other papers [2,3,4].
19
28
20
29
# Building
21
30
@@ -33,21 +42,20 @@ Please refer to OpenCV building tutorials for further details, if needed.
33
42
34
43
The built target can be tested as follows:
35
44
```
36
-
example_alphamat_information_flow_matting -img=<path to input image file> -tri=<path to the corresponding trimap> -out=<path to save output matte file>
45
+
<path to your opencv build directory>/bin/example_alphamat_information_flow_matting -img=<path to input image file> -tri=<path to the corresponding trimap> -out=<path to save output matte file>
[1] Yagiz Aksoy, Tunc Ozan Aydin, Marc Pollefeys, "[Designing Effective Inter-Pixel Information Flow for Natural Image Matting](http://people.inf.ethz.ch/aksoyy/ifm/)", CVPR, 2017.
53
+
[1] Yagiz Aksoy, Tunc Ozan Aydin, Marc Pollefeys, [Designing Effective Inter-Pixel Information Flow for Natural Image Matting](https://www.researchgate.net/publication/318489370_Designing_Effective_Inter-Pixel_Information_Flow_for_Natural_Image_Matting), CVPR, 2017.
46
54
47
-
[2] Roweis, Sam T., and Lawrence K. Saul. "[Nonlinear dimensionality reduction by locally linear embedding](https://science.sciencemag.org/content/290/5500/2323)" Science 290.5500 (2000): 2323-2326.
55
+
[2] Roweis, Sam T., and Lawrence K. Saul. [Nonlinear dimensionality reduction by locally linear embedding](https://science.sciencemag.org/content/290/5500/2323), Science 290.5500 (2000): 2323-2326.
48
56
49
-
[3] Anat Levin, Dani Lischinski, Yair Weiss, "[A Closed Form Solution to Natural Image Matting](https://www.researchgate.net/publication/5764820_A_Closed-Form_Solution_to_Natural_Image_Matting)", IEEE TPAMI, 2008.
57
+
[3] Anat Levin, Dani Lischinski, Yair Weiss, [A Closed Form Solution to Natural Image Matting](https://www.researchgate.net/publication/5764820_A_Closed-Form_Solution_to_Natural_Image_Matting), IEEE TPAMI, 2008.
0 commit comments