Optimize cvtcolor, convert from yuv2 to bgr
After profiling my x3399 board(arm cores) using DS-5 streamline I realized that the most heavy function in my system is cvGetHuMoments, after deep search in my code I realized that this function is related to cvtcolor conversion from yuv2 to bgr? is it possible? I can`t find in my profiler where exactly I use the cvGetHuMoments function but when I disable the cvtcolor conversion it disappeared in the profiler. If the problem is with cvtcolor, how would you recommend to optimize it? I thought about using opencl or neon optimization(arm compute library) but could not really understand how to implement it in my code, I would be happy to get a tutorial on how to implement it(replace the cvtcolor in my code). Thanks
those functions are unrelated.
which opencv version is it ?
there is a test which uses cvGetHuMoments but that's the only place where that is used (you also should NOT use any functions from the deprecated C-api in your code)
none of your assumptions make any sense here (that's the good news !)
opencv version = 3.3
Is there a list of functions which use cvGetHuMoments?
you can grep the opencv src code, or the github repo (which i did above)
also look at the src for it -- 7floats going in, another 7 going out, a few mults. entirely unlikely, that this should use any significant resources. (it's also only used for shape analysis)
cvtColor, however is another kind of beast. it has to manipulate whole, multi-channel images. it would make a lot of sense, if that showed up high in your usage profile. (and no, you probably can't write any program without it)
OK, so how I can optimize the cvtcolor function?
have a look at the src and try to find out, which optimizations are used, and available on your board.
parallel_for_
is used a lot, so make sure, you have someParallel Framework
like tbb,omp,phtreads enabledsorry, i can't help any further here.