Skip to content

Commit 393f752

Browse files
Merge pull request #4 from sunitanyk/test_alphamatte_sn
Test alphamatte sn
2 parents 0c16f1e + 07dafff commit 393f752

File tree

13 files changed

+39
-57
lines changed

13 files changed

+39
-57
lines changed

modules/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ $ cmake -D OPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules -D BUILD_opencv_<r
1010

1111
- **aruco**: ArUco and ChArUco Markers -- Augmented reality ArUco marker and "ChARUco" markers where ArUco markers embedded inside the white areas of the checker board.
1212

13+
- **alphamat**: Computer Vision based Alpha Matting -- Given an input image and a trimap, generate an alpha matte.
14+
1315
- **bgsegm**: Background segmentation algorithm combining statistical background image estimation and per-pixel Bayesian segmentation.
1416

1517
- **bioinspired**: Biological Vision -- Biologically inspired vision model: minimize noise and luminance variance, transient event segmentation, high dynamic range tone mapping methods.

modules/alphamat/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ E represents the deviation of unknown pixels opacity or colour from what we pred
1919

2020
Pre-processing and post-processing is implemented in **trimming.hpp**
2121

22-
To run the code -
23-
1. **g++ -std=c++11 alphac.cpp \`pkg-config --cflags --libs opencv\`**
24-
1. **./a.out \<path to image> \<path to corresponding trimap>**
22+
Compile the module using -
23+
```
24+
cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules -Dopencv_alphamat=ON <opencv_source_dir>
25+
make
26+
```
2527

26-
Sample image and trimap are in opencv_contrib/modules/alphamat/src/img and opencv_contrib/modules/alphamat/src/trimap
28+
Sample image and trimap are in opencv_contrib/modules/alphamat/src/input_images and opencv_contrib/modules/alphamat/src/trimaps
2729

2830
## Results
2931

modules/alphamat/tutorials/alphamat_information_flow/alphamat_information_flow.markdown

Lines changed: 0 additions & 49 deletions
This file was deleted.
Loading
Loading
Loading
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Information Flow AlphaMatting {#tutorial_alphamat_information_flow}
2+
=============================
3+
4+
Alphamatting is the problem of extracting the foreground from an image. Given the input of image and its corresponding trimap, we try to extract the foreground from the background. Following is an example -
5+
6+
Input Image: ![](images/net_input_image.jpg)
7+
Input Trimap: ![](images/net_trimap.jpg)
8+
Output alpha Matte: ![](images/net_result.jpg)
9+
10+
Build the module using -
11+
```
12+
cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules -Dopencv_alphamat=ON <opencv_source_dir>
13+
make
14+
```
15+
16+
Usage Example
17+
-------------
18+
19+
@includelineno alphamat/samples/information_flow_matting.cpp
Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
Tutorials for alphamat module {#tutorial_table_of_content_alphamat}
2-
===============================================================
1+
Information Flow Alpha Matting {#tutorial_table_of_content_alphamat}
2+
==============================
33

4-
- @subpage tutorial_alphamat_information_flow
4+
- @subpage tutorial_information_flow_matting
55

6-
In several applications, we need to extract foreground for further operations like changing the background in an image. Information-Flow Matting is a computer vision approach to compute alphamatte of objects in images.
6+
*Author:* Muskaan Kularia
7+
8+
*Mentor:* Sunita Nayak
9+
10+
This project was part of Google Summer of Code 2019.
11+
12+
In several applications, we need to extract foreground for further operations like changing the background in an image. Information-Flow Matting is a computer vision approach to compute alphamatte of objects in images. This work is based on the following paper:
13+
14+
Yagiz Aksoy, Tunc Ozan Aydin, Marc Pollefeys, [Designing Effective Inter-Pixel Information Flow for Natural Image Matting](http://people.inf.ethz.ch/aksoyy/papers/CVPR17-ifm.pdf), CVPR, 2017.

0 commit comments

Comments
 (0)