Forums

Fast C or C++ library for matrices convolution / filtering ?

Started by simonzz 4 years ago9 replieslatest reply 4 years ago2814 views

Hi, 

I am working on a image processing software, and it needs to compute filtering very frequently, typical frame size is greater than 1 M pixel.

I know that there are many C & C++ libraries available that can be helpful (I only know the existence of -but not tested yet- FFTW and GST (Gnu Scientific Library)).

Before starting testing all the possible libraries that I can find, I appreciate to read some reliable suggestion from experts on the topic (and I think this is one is the perfect community to ask for it).

Do you have any suggestion for this particular topic ?

Thank you in advance.

Simon

[ - ]
Reply by napiermJanuary 10, 2018

If you end goal is speed, you might consider bringing in the VOLK libraries.  These are used in GNURadio as part of the real-time signal processing library.


https://wiki.gnuradio.org/index.php/Volk



[ - ]
Reply by simonzzJanuary 10, 2018

Thank you @napierm, I didn't know VOLK libs.

[ - ]
Reply by jbrowerJanuary 10, 2018

Simon-

Have you looked at OpenCV ?  What platform are you running on and how many cores ?

OpenCV includes image convolution, and has the *potential* to be fast depending on the platform you're using.  To take advantage of multiple cores, for x86 you can enable a "have OpenMP" flag and for GPU you can enable a "have CUDA" flag.

-Jeff

[ - ]
Reply by simonzzJanuary 10, 2018

Hello @jbrower,

I have tried OpenCV but I am looking to something faster than that (if possible).

If I don't end up with an alternative solution, it's probable that I will use them again.

Simon

[ - ]
Reply by jbrowerJanuary 10, 2018

Simon-

Are you unable to answer my question for proprietary or other reasons; i.e. which platform you're using (which CPU or SoC) and how many cores you have available ?

With that info possibly I could suggest (i) a way to make OpenCV faster or (ii) other alternative.

-Jeff

[ - ]
Reply by simonzzJanuary 10, 2018

Hello @jbrower,

Sorry. I missed that info.The CPU I am working on is a APQ8016E (Qualcomm SnapDragon 410e).

Thank you for your interest. I really appreciate this.

Regards,

Simon


[ - ]
Reply by jbrowerJanuary 10, 2018

Simon-

Got it.  For SnapDragon I can't make an OpenCV specific or other recommendation now, but possibly in a month or two, as for a major outfit we're doing a deep learning platform energy efficiency comparison between Jetson TX2, Atom x5-E3940, and TI c66x (c6678).  They are thinking about adding SnapDragon 835.

-Jeff

[ - ]
Reply by csureshJanuary 10, 2018

I have used blitz C++ library and it supports all MATLAB style operations including convolution and it is faster too.

You can check it out at https://sourceforge.net/projects/blitz/

[ - ]
Reply by simonzzJanuary 10, 2018

Thank you @csuresh. I am going to take a look at it.

Simon