Skip to content

Interactive GrabCut using OpenCV implementation

Notifications You must be signed in to change notification settings

hector-sab/GrabCut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interactive GrabCut

Interactive implementation of OpenCV GrabCut

How to use it?

from grabcut3 import GrabCut
#Create a GrabCut object
gc = GrabCut()
gc.load_image('avengers.jpg')
gc.matte()

Options

Once you have executed the matte() method there are several options available:

r: reset the image and all grabcut parameters
n: run grabcut algorithm to matte the image
s: save the results
e: exit
0: mark background
1: mark foreground
2: mark probable background
3: mark probable foreground
+: increase size of brush
-: decrease size of brush
c: Crop ROI

You can also specify the name of the resulting image and mask, and its output directory

gc.output_params(out_dir='Output/Directory/', mask_name='MaskName0', img_name='ImageName0')

About

Interactive GrabCut using OpenCV implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages