Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 2.22 KB

README.md

File metadata and controls

54 lines (40 loc) · 2.22 KB

Graph-Cut-Segmentation

As applied in the field of computer vision, graph cut optimization can be employed to efficiently solve a wide variety of low-level computer vision problems, such as image smoothing, the stereo correspondence problem, image segmentation, object co-segmentation, cv problems that can be formulated in terms of energy minimization.

Overview

Let us apply Graph-cuts for foreground/background segmentation. In the “cat” image, you are given a rough polygon of a foreground cat. Apply graph-cut based method to see if we can get a better segmentation!

Firstly, use the provided polygon to obtain an estimate of foreground and background color likelihood. You may choose the likelihood distribution (e.g., color histograms or color mixture of Gaussians.).

Secondly, apply graph-cut code (cv2.grabcut) to do better segmentation. You can use the provided bounding-boxes and use "cv2 package" for the implementation sake. You are required to draw interesting conclusions on how it performs on different samples.

Usage

Run GraphCut.ipynb in Jupyter Notebook or Google Colab

Results

1

Original Image

4

Gaussian Mixture Model

3

Foreground Probability Map

2

Background Probability Map

3

Foreground Mask

2

Result

Folder Structure

📦Graph-Cut-Segmentation
 ┣ 📂Results
 ┃ ┣ 📜bg_p_map.png
 ┃ ┣ 📜eg_r.png
 ┃ ┣ 📜fg_mask.png
 ┃ ┣ 📜fg_p_map.png
 ┃ ┣ 📜gauss.png
 ┃ ┗ 📜og_img.png
 ┣ 📜.gitignore
 ┣ 📜GraphCut.ipynb
 ┣ 📜LICENSE
 ┗ 📜README.md