DiegoCatalano / Catalano-Framework

Framework
GNU Lesser General Public License v3.0
295 stars 99 forks source link

Optimizing convolution #3

Open ForThoseAboutToCode opened 9 years ago

ForThoseAboutToCode commented 9 years ago

Hello,

I've been running few algrothms against my material (>50MB images). Do you have in your roadmap a slot to optimize the Convolution process to use direct pixel byte/int arrays (produced by FastBitMap.getGrayData() and FastBitMap.getRGBData()) instead of using copy.getGray/Red/Green/Blue methods?

This might speed up things (blurs, edgedetectors) considerably.

BR, Saku

DiegoCatalano commented 9 years ago

Hello,

In the next version (1.4) contains separable convolution. It's very fast than convolution. I got the results below:

Processor: Intel(R) Core(TM) i7 -2670QM CPU @ 2.20 GHz Image: RGB 1400x1026 Kernel used in convolution: 21x21 (all elements equals 1) mean filter.

  Filter                        Threads                     Time(ms)
  Convolution                        1                        6058
  Convolution                        8                        1892
  Separable Convolution*             1                         838

*Separable Convolution works like Convolution, only have a restriction, the kernels must be separable.

Answering your question, in the next version (1.4) I intend to point operations filters to access direct pixel arrays. Now filters that use neighbours (e.g convolution) in the version (1.5). Or, if I have time in this end of this year. I'll to do at least for the convolution.

Best regards, Diego

ForThoseAboutToCode commented 9 years ago

Hi,

Excellent results there :) I'll be using the 1.3 version..or compile a some immediate version for my needs until you release the 1.4. Good work!

Br, Saku

DiegoCatalano commented 9 years ago

Hello,

I'm writting a new convolution based on fourier transform, It's more faster than convolution, and allow deconvolution too.

Best regards, Diego Catalano

ForThoseAboutToCode commented 9 years ago

Hello,

Oh..nice timing..I'm currently testing a few kernels (from ConvolutionKernel) for my needs. It will be nice to see the eventual difference in the performance :)

Best Regards, Saku