Giter VIP home page Giter VIP logo

qilicarol / iterative-grabcut Goto Github PK

View Code? Open in Web Editor NEW

This project forked from louisfb01/iterative-grabcut

0.0 0.0 0.0 951 KB

This algorithm uses a rectangle made by the user to identify the foreground item. Then, the user can edit to add or remove objects to the foreground. Then, it removes the background and makes it transparent.

Home Page: https://www.louisbouchard.ai/grabcut-notebook-implementation/

Jupyter Notebook 100.00%

iterative-grabcut's Introduction

iterative-grabcut: Using simple rectangle for identifying foreground items

This algorithm uses a rectangle made by the user to identify the foreground item. Then, the user can edit to add or remove objects to the foreground. Once done, it removes the background and makes it transparent (adds alpha channel) and saves it.

This is a simple notebook implementing the GrabCut algorithm shown in the High-Quality Background Removal Without Green Screens | State of the Art Approach Explained video on What's AI's channel.

How does it work? With example

  1. Upload your image.
  2. Create a rectangle over your image including all your foreground objects.
  3. Remove the background using GrabCut algorithm.
  4. If improvement is needed, draw on the image, left click (white) = foreground and right click(black) = background.
  5. Remove the background using GrabCut algorithm.
  6. Return to step 4 or end.

Video demos

Example with one iteration to correct the first pass of the algorithm:

2020-08-22_18-02-12_1.mp4

Example with harder picture and multiple iterations:

2020-08-22_18-02-12.mp4

Results:

References:

Interactive Foreground Extraction using GrabCut Algorithm, OpenCV, (2013), https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_grabcut/py_grabcut.html

iterative-grabcut's People

Contributors

louisfb01 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.