OpenCV is great as a black box but its built in functions are not always sufficient or optimal.
EDIT2: deleted as the src has been truncated, http://pastebin.com/dPMsRF78
- It's really hard to make valid comparisons against data I don't have access to. Do you have any open data sets to try this comparison against?
- It looks like the meat of the work is being done here by scikit-learn. As was mentioned earlier, Numba at this stage is mostly useful for improving kernel performance, not large library routines.
I'm planning on taking a deeper look into some of the scikit-learn kernels in the future. Keep an eye open for a blog post from Continuum on this.
Yeah I use openCV and scikit learn to do the heavy lifting indeed. But then if I used Numba surely that is what you are advocating too?? I tried unrolling the inner kernel a few different ways before settling on the code you have before you. It doesn't compute the feature vector exactly how I would want, BUT ITS really FAST, which for sonar analysis to run on AUV in real time that's essential. I will fit my math to the library to meet my CPU budgets. Anyway I hope you can use this as a benchmark or something even if its implemented in a totally different way than you might do.
feel free to email me tom dot larkworthy <at> gmail
Tom
Now my algorithm is sparse so its normally jsut selecting a subset of pixels, although as it calculated the spatial responses of the whole image it doesn't really make any odds to my runtime.