Is findContours fast enough ?

asked 2014-05-02 03:01:25 -0600

glupescu gravatar image

updated 2014-05-02 03:39:36 -0600

For current vision algorithms (e.g. object detection, object enhancing) does findCountours perform fast enough ? I've studied the algorithm behind it [1] and by a first look it's rather difficult to perform in parallel especially on SIMD units like GPUs. I took a usage example from [2] and did a simple trace of findCountours on [3] and [4]. While [3] requires 1ms, [4] requires about 40ms (AMD 5400K @3.6ghz). If high resolution video processing frame by frame is considered these results could be problematic. I think i may have an ideea for a faster algorithm oriented towards SIMD units. So i would like some feedback from people who have worked in vision problems to the question:

Is findCountours fast enough for current problems on current hardware ? Would improving it help in a significant way any specific algorithm ?

Thank you in advance, Grigore

[1] http://tpf-robotica.googlecode.com/svn-history/r397/trunk/Vision/papers/SA-CVGIP.PDF [2] http://docs.opencv.org/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.html [3] http://jerome.berbiqui.org/eusipco2005/lena.png [4] http://www.lordkilgore.com/wordpress/wp-content/uploads/2010/12/big-maze.png

edit retag flag offensive close merge delete

Comments

I am wondering how object detection and findContours work together. I am working fulltime on object detection using the viola-jones cascade classification, the latentSVM of felzenszwalb and the dollar channelftrs framework which are all state of the art techniques and none of them need findContours ...

StevenPuttemans gravatar imageStevenPuttemans ( 2014-05-02 03:18:03 -0600 )edit

It was more of an assumption than a confirmation. I previously worked on image vectorization (raster->vector, e.g. algorithm [1],[2]) and noticed that contour extraction was one of the problems on large scale images (such as maps). The question is actually more oriented towards "are there any problems that require fast contour extraction" or is there a scenario where "contour extraction is the slowest step" ? I think image vectorization is not enough for me to continue and invest time into this topic.

[1]http://www.imageprocessingplace.com/downloads_V3/root_downloads/tutorials/contour_tracing_Abeer_George_Ghuneim/intro.html [2] http://potrace.sourceforge.net/potrace.pdf

glupescu gravatar imageglupescu ( 2014-05-02 03:44:36 -0600 )edit
1

So you want insight in the fact 'is it interesting to improve the findContours algorithm' ?

StevenPuttemans gravatar imageStevenPuttemans ( 2014-05-02 05:30:49 -0600 )edit
1

Yes. I mean i have an idea how to make it faster but would like to write it for GPUs using OpenCL and that would take some time. And if i manage to improve it by a % margin why would anyone bother integrating it or checking it out if contour extraction itself isn't very used (assuming) hence the current OpenCV findCountour would be enough for most people.

glupescu gravatar imageglupescu ( 2014-05-02 06:54:52 -0600 )edit
1

It is usefull in many other cases. I for example use it to detect blobs after an optimized segmentation. Increasing the blob detection process is always usefull.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-05-02 07:11:12 -0600 )edit

Thank you, I am also meet this problem. Does UMat can do it?

eatcosmos gravatar imageeatcosmos ( 2018-08-26 22:23:05 -0600 )edit