Structured edge detection performance
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!
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?
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
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.
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.