1
votes

I'm working on a high resolution data set for extracting desired image objects. To do this, I have applied HOG + SVM. Although the results I get are very promising and operationally accepted, the speed of this task is annoying! For each image, which is of size 2800 * 1400, the algorithm takes 4 minutes to be done, which is far from the time I need. Most of this time is taken for performing sliding window. I need this recognition procedure to be done within only 10 seconds. Since I make the use of Matlab, it seems that reaching 10 seconds is impossible and I have to think of C++. However, I've never worked with C++ and haven't enough time to learn it for this task.

I would be grateful to know that is there any ways to speed up the sliding window in Matlab or Python to perform the recognition in under 1 minute?

1
It may be worth posting the code that you have on the Code Review site for suggestions on optimization.Suever
Not only will you need to use a language like C++ to improve efficiency, but you'll probably need to use CUDA to offload a majority of the computational overhead onto GPUs. I believe there are CUDA extensions/libraries for Python as well. Doing it in Matlab with only the use of a CPU will not get you even close to under a minute, let alone under 10 seconds.Scott Mudge
Many thanks to both of you for your helpful comments. @Scott, if there exists CUDA modules for Python, is it possible to get the goal without employing C++?Federico
Depending on the performance of the GPUs available to CUDA and the efficiency of your algorithms, certainly.Scott Mudge
If you have the parallel computing toolbox, you also have CUDA support in Matlab.Jonas

1 Answers

2
votes

Does it have to be HOG-SVM?

If not, then you can use the trainCascadeObjectDetector function in the Computer Vision System Toolbox. It trains a boosted cascade classifier, and it gives you a choice of HOG, LBP, and Haar features. Then you can use vision.CascadeObjectDetector, which implements the sliding windows internally using native code, making it much faster.

See matlab documentation on training a cascade object detector.