Grabcut GIMP plugin

(Antonio) #1

I’m searching for an implementation of Grabcut for GIMP.

GrabCut is an image segmentation method based on graph cuts.

Starting with a user-specified bounding box around the object to be segmented, the algorithm estimates the color distribution of the target object and that of the background using a Gaussian mixture model.

The results it gives look pretty rough. There are other/better methods but I quite like that rough aesthetic.

Screenshot%20from%202019-03-17%2015-32-41

I’ve stumbled upon a 2006 academic paper that says it’s made a GIMP plugin https://dl.acm.org/citation.cfm?id=1108618 However, I can’t find this plugin. Does anyone know where I can find it or another plugin that implements Grabcut in GIMP?

0 Likes

#2

Hi @hellocatfood,

Not really the same, but I wonder if you have checked the Foreground Select Tool in Gimp?

Have fun!
Claes in Lund, Sweden

0 Likes

(Antonio) #3

Yes, I’ve used the Forground Select tool before. However, it works differently in that you have to draw around your area and then mark pixels. Grabcut allows you to just draw a box around your selection and it attempts to extract it.

0 Likes

#4

GIMP uses the SIOX method, which has been implemented in many FLOSS apps. It can actually be done on a rectangular area as well but labelling components within the area makes it even more accurate. You can do the same with Grabcut, so it comes down to SIOX vs Grabcut. Actually SIOX has advantages over Grabcut; in particular, noise and video.

0 Likes

(Antonio) #5

In the end I made my own standalone grabcut implementation https://github.com/hellocatfood/grabcut-gui

Unlike the other implementations that I’ve seen it gives you a GUI to do the grabcut-ing and doesn’t resize the input in order to fit it on screen.

Peek%202019-03-21%2013-28

cat(64%2C%2022%2C%20128%2C%20100)

It also attempts to apply an alpha mask, although this can be improved.

3 Likes

#6

Seems like you are quite capable. Would you mind writing the plugin for GIMP? I believe the site admins could store it for you if it goes well.

0 Likes

(Antonio) #7

Nope, I can’t write a GIMP plugin.

0 Likes

(http://4232.cf) #8

Write a plugin of gimp is not so very difficult.
But this can do it foreground extraction:

1 Like

#9

@bazza The G’MIC filter still requires labelling. @hellocatfood only wants to mark the ROI with a rectangle, which GrabCut and SIOX can both do. However, as I said above, labelling refines the selection and gives one a better extraction.

0 Likes

(http://4232.cf) #10

@afre It would be interesting a method “extract foreground [with colormap]”

0 Likes

(Antonio) #11

@bazza if it’s not difficult then you’re welcome to do it yourself.

@afre as I mentioned in my first post I like the rough cut aesthetic of grab cut. I’m aware of the foreground selection tool (and other similar tools) and how much more precise it is.

0 Likes

#12

I am not disputing your claim. I am merely saying that, depending on the implementation, GrabCut can have labelling. Same with SIOX: it could be standalone, or with labelling, as it is in GIMP.

If you are comfortable with OpenCV, by all means, use it. It is a powerful package. :+1:

1 Like