Skip to content

A simple app for interactively removing the background from an image using the grab cut algorithm and OpenCV.

License

Notifications You must be signed in to change notification settings

CauldronDevelopmentLLC/grabcut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grabcut

A simple program for interactively removing the background from an image using the grab cut algorithm and OpenCV.

This code was derived from the Grab Cut example from the OpenCV project but is hopefully more usable for day-to-day tasks.

See the OpenCV GrabCut Tutorial for more information.

Examples

Orignal Image Result Image Orignal Image Result Image

Usage

grabcut.py <input> [output]

Operation

At startup, two windows will appear, one for input and one for output.

To start, draw a rectangle around the object using mouse right button. For finer touch-ups, press any of the keys below and draw circles to mark the background and foreground. Finally, press 's' to save the result.

Keys

  • 0 - Select areas of sure background
  • 1 - Select areas of sure foreground
  • 2 - Select areas of probable background
  • 3 - Select areas of probable foreground
  • n - Update the segmentation
  • r - Reset the setup
  • s - Save the result
  • q - Quit

About

A simple app for interactively removing the background from an image using the grab cut algorithm and OpenCV.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages