My app uses opencv's cv::findContours on a binary image. I now need to make it realtime. GPUImage has a cannyedge filter but I couldn't find anything related to findContours. Does GPUImage have anything that closely resembles findContours? If not, can someone suggest an alternative? Thanks
Asked
Active
Viewed 4,018 times
14
-
5There isn't anything in there that does this right now. It's a tricky problem to get working on GPUs. I was recently reading through Sean O'Connell's paper on a technique for this: ftp://ftp.heanet.ie/mirrors/sourceforge/g/gc/gccl/paper_draft.pdf but even there he doesn't see a huge speedup in determining connected objects on the GPU. As a halfway measure, you might be able to run your edge detection first on the GPU, then read out the results from that for CPU-bound processing. You'd at least get a little speedup from that. – Brad Larson Nov 02 '12 at 16:07
-
I think I will go that route. What's the best/efficient way to convert the raw buffers after running a filter into cv::Mat? I tried converting it to -> UIImage -> cv::Mat but that takes too long. – 0xSina Nov 09 '12 at 06:53
-
2Try a GPUImageRawDataInput, where you should be able to feed in raw RGBA (or BGRA, I forget the byte order) data without having to pass through Core Graphics for a UIImage. – Brad Larson Nov 09 '12 at 17:06
1 Answers
1
There was an issue reported in this regard in 2015. https://github.com/BradLarson/GPUImage/issues/2094
The answer of that issue states that GPUImage does not offer any such alternative at the moment. So the best guess might be to feed the output from GPUImage's Canny or Sobel edge detection into a contour determination operation outside of the GPUImage framework.

Muhammad Abdullah
- 876
- 2
- 8
- 26