Structured edge detection performance

asked 2017-01-27 03:43:45 -0600

Jaykob gravatar image

updated 2017-01-27 03:44:32 -0600

Hi, I'm using the StructuredEdgeDetection algorithm of the ximgproc module. Reading the according paper I was under the impression that it would be a fast algorithm suitable for realtime purposes.

However, it's taking 5.4 secs on my i7 MacBook Pro to process a 2592x1944 image. Is this resolution just too high or what could I do to improve the speed? I saw that parts of the code are supposed to make use of OpenMP. Since I'm targeting mobile devices (iOS, Android), I built OpenCV 3.2 with TBB support so far. Would you suggest modifying the code to make use of TBB instead of OpenMP in my situation or are there other things that I could try?

Thanks for your support!

edit retag flag offensive close merge delete

Comments

Structered Edges have been evaluated on the Berkely Segmentation dataset according to the original Microsoft paper. The dataset contains images of 481px × 321px, where they report processing of 6FPS for multiscale on a 4 core machine, and 60FPS for single scale. So my guess, it is indeed the resolution. Are you doing singlescale or multiscale?

StevenPuttemans gravatar imageStevenPuttemans ( 2017-01-27 04:48:27 -0600 )edit
1

I didn't even know that I can influence this without modifying the code - or did I miss something? From looking briefly at the code I'm guessing 2 scales (1.0 and 0.5) are being used, though. Update: Images of size 400x300 take about 110ms on my machine

Jaykob gravatar imageJaykob ( 2017-01-27 05:10:01 -0600 )edit

Then it is probably not using multiple cores OR its just not as efficiently implemented as the original paper. Try disabling TBB and enabling OpenMP then.

StevenPuttemans gravatar imageStevenPuttemans ( 2017-01-27 06:55:45 -0600 )edit
1

AFAIK OpenMP is not an option for iOS/Android, but correct me if I'm wrong. At least it's not building on my Mac right now. I might adopt the code to use TBB instead of OpenMP, ass TBB runs fine on both platforms.

Jaykob gravatar imageJaykob ( 2017-01-30 04:42:55 -0600 )edit