liuliu / ccv

C-based/Cached/Core Computer Vision Library, A Modern Computer Vision Library
http://libccv.org
Other
7.08k stars 1.72k forks source link

SCD Speed #126

Closed henryl closed 7 years ago

henryl commented 9 years ago

SCD speed is much slower than OpenCV Haar Cascade with comparable configuration parameters on iOS devices. This is probably due to key parts of the algorithm being implemented with SSE2 but not with equivalent NEON instructions. With libccv I get about 1hz with an input of 360x480 (interval = 5, size = 48x48) on an iphone5s. Without BBF or SCD speed improvements, we won't have a near real time object detector (analogous to the LBP detector in OpenCV) for mobile devices.

liuliu commented 9 years ago

What's the numbers you have with OpenCV? How many threads you are using with OpenCV? Yes, it is definitely one of the goals to run SCD smoothly on mobile devices. Unfortunately, my NEON enabled test environment is broken recently, so haven't got a chance to work on that yet.

henryl commented 9 years ago

OpenCV is multithreading enabled. Running it with these options cascade.detectMultiScale(image, faces, 1.1, 2, 0, cv::Size(44, 44)) and getting something like 6.5 to 7FPS.

I did a naive 1 for 1 translation of the SSE instructions to their respective NEON intrinsics and got a 30-40% boost, but it is still lagging behind OpenCV pretty badly (probably due to multithreading?)

If you were to multithread the SCD code where would you start?

morenoh149 commented 9 years ago

@henryl Web Workers might work https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/basic_usage edit: whoops thought this was the js CV library. nevermind! :)

henryl commented 9 years ago

By the way, @liuliu you might be interested in this: https://github.com/nenadmarkus/pico

I get 30fps on an iphone5s with great accuracy.

liuliu commented 9 years ago

It looks like an improvement over BBF implementation here, not sure if they've done their FDDB test correctly or not (there are tricks to improve FDDB result without any classifier modification, as discussed in http://markusmathias.bitbucket.org/2014_eccv_face_detection/). If FDDB result is correct though, the ROC graph is not as good, which confirms that without higher level feature, it is hard to do more generic object detection with pixel-level features.