Can an image segmentation algorithm, such as GrabCut, work on the iPhone GPU?

I worked with the GrabCut algorithm (as implemented in OpenCV) on the iPhone. The performance is terrible. It takes about 10-15 seconds to run even on a simulator for an image of about 800x800 size. It works on my phone for several minutes, in the end the memory and crash ends (iPhone 4). I am sure that there may be some kind of optimization that I can do if I write my own version of the algorithm in C, but I get the feeling that no optimization will allow me to get it somewhere close to use. I worked out some performance measurements in some academic papers and even saw 30 second battery life on 1.8 GHz multi-core processors.

So, my only hope is the GPU, which I know nothing about. So far, I have conducted basic research on OpenGL ES, but this is a pretty deep topic, and I do not want to spend hours or days studying basic concepts so that I can find out if I am turned on or not. the right way.

So my question is twofold:

1) Can something like GrabCut run on the GPU? If so, I would like to have a starting point other than "learn OpenGL ES." Ideally, I would like to know which concepts I need to pay particular attention to. Keep in mind that I have no experience with OpenGL and very little experience with image processing.

2) Even if this type of algorithm can be run on the GPU, what performance improvement should I expect? Given that the current runtime is about 30 seconds AT BEST on the processor, it seems unlikely that the GPU will put a large enough dent at runtime to make the algorithm useful.

EDIT: in order for the algorithm to be โ€œuseful,โ€ I think it had to work in 10 seconds or less.

Thanks in advance.

+4
source share
1 answer

Grabcut doesn't seem to help in image resolution. This means that the quality of the result does not depend directly on the quality of the input image. On the other hand, performance depends on the size, which means that the smaller the image, the faster the cutout execution algorithm is executed. So, try scaling the image to 300x300, apply grabcut, remove the mask, scale the mask to its original size and apply the mask to the original image to get the result. Let me know if this works.

Luke

+2
source

All Articles