Giter VIP home page Giter VIP logo

grabcut's Introduction

Grabcut

Labeling tool for machine vision based segmentation, based on work by Kris Kitani

Dependencies

IDE

This project is ported to work in Apple's Xcode; it tested with Xcode 7.3.1.

This project also uses the OpenCV library; it is tested with Versions or 2.4.12 and 2.4.13.

Installing OpenCV on OS X

Two ways to install OpenCV on OS X; we recommend the first:

  1. Use Homebrew, from the terminal:
brew update
brew tap homebrew/science
brew install opencv
* Note: Make sure OpenCV's dependencies are also installed, you can check using `brew info opencv`
  1. Download OpenCV and building it using cMake * This tutorial provides greater detail for setting up OpenCV with cMake and Xcode.

Project Installation

To install the Grabcut project, complete the following steps:

  1. Clone this repository:
git clone with https://github.com/cmuartfab/grabcut.git`
  1. Double click grabcut.xcodeproj to open it in Xcode

  2. Navigate to the /usr/local/lib directory and select all of the libopencv.dylib files and drag and drop them into the lib folder in the Xcode project. You should see all the libopencv.dylib files in the Grabcut project lib folder.

  3. In the Xcode project's build settings Under targets on the left column, select grabcut.

  4. Make sure the paths under Library Search Paths inclure the directory where OpenCV is installed on your machine. If you used Homebrew to install OpenCV, it should be in usr/local/Cellar

Running the Xcode project

  1. Double click grabcut.xcodeproj to open it in Xcode
  2. grabcut/main.cpp, update this line with the right path to the datasets folder
string root = "/xxx/dataset/";	//Update this line to point to your dataset folder
  1. To label and generate masks for new images, add new images to 'dataset/img/ASAP/' and name them using names with the format 00000xxx.jpg, starting at 101, like this:
00000101.jpg
00000102.jpg
00000103.jpg
...
  1. Label the foreground and background with the following keys:
  • 'b' - Background Mode: using the mouse, draw Green lines on the background, outlining the foreground object (see top left of image below)
  • 'f' - Foreground Mode: using the mouse, draw Red lines within the outline of the foreground object (see top left of image below)
  • 'd' - Done: moves to the next image
  • 'r' - Reset: resets current image

alt tag

  • Top Left: Green background and red foreground lines
  • Top Right: Foreground background separation; Foreground in pulple, and background in green
  • Bottom Left: calculated mask
  • Bottom Right: Mask applied to original source image

grabcut's People

Contributors

batchku avatar schivuk avatar

Watchers

 avatar  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.