Skip to content

LingzheM/py-grabcut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A minimal, self‑contained re‑implementation of the GrabCut algorithm that avoids OpenCV's built‑in cv2.grabCut. It relies only on

  • NumPy – array maths
  • scikit‑learn – GaussianMixture for colour modelling
  • PyMaxflow – graph‑cut / max‑flow optimisation
  • scikit‑image – I/O convenience (can be replaced by imageio/Pillow)

Quick start
$ pip install numpy scikit‑learn PyMaxflow scikit‑image
$ python simple_grabcut.py input.jpg output.png --rect 50 50 200 300 --iter 5

The script will write an RGBA PNG whose alpha channel comes from the estimated foreground mask.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages