opencv / GrabCut / 0.1.5

Performs the GrabCut image segmentation algorithm on an image (data uri, base64 encoded, or web url) and returns the foreground.

The specified region is used to focus the algorithm on an object of interest in the image and must be smaller than the region of the whole image.

Input consists of:

  • The image to process, either as a Data API url (data://), a web url (http://), base64 encoded file, or as a raw POST body.
  • Optionally accepts a 2nd argument which specifies the bounding box of the foreground (eg- {"x": 1, "y": 1, "width": 150, "height": 150})
  • Optionally the 2nd argument can be a single integer which specifies how many pixels to shrink the window by, relative to the full image